Module: Gitlab::Client::AccessRequests

Included in:
Gitlab::Client
Defined in:
lib/gitlab/client/access_requests.rb

Overview

Defines methods related to Award Emojis.

Instance Method Summary collapse

Instance Method Details

#approve_group_access_request(group, user_id, options = {}) ⇒ Gitlab::ObjectifiedHash

Approves a group access request for the given user.

Examples:

Gitlab.approve_group_access_request(1, 1)
Gitlab.approve_group_access_request(1, 1, {access_level: '30'})

Parameters:

  • :group(required) (Integer, String)

    The ID or name of a group.

  • :user_id(required) (Integer)

    The user ID of the access requester

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :access_level(optional) (Integer)

    A valid access level (defaults: 30, developer access level)

Returns:



75
76
77
# File 'lib/gitlab/client/access_requests.rb', line 75

def approve_group_access_request(group, user_id, options = {})
  put("/groups/#{url_encode group}/access_requests/#{user_id}/approve", body: options)
end

#approve_project_access_request(project, user_id, options = {}) ⇒ Gitlab::ObjectifiedHash

Approves a project access request for the given user.

Examples:

Gitlab.approve_project_access_request(1, 1)
Gitlab.approve_project_access_request(1, 1, {access_level: '30'})

Parameters:

  • :project(required) (Integer, String)

    The ID or name of a project.

  • :user_id(required) (Integer)

    The user ID of the access requester

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :access_level(optional) (Integer)

    A valid access level (defaults: 30, developer access level)

Returns:



61
62
63
# File 'lib/gitlab/client/access_requests.rb', line 61

def approve_project_access_request(project, user_id, options = {})
  put("/projects/#{url_encode project}/access_requests/#{user_id}/approve", body: options)
end

#deny_group_access_request(group, user_id) ⇒ void

This method returns an undefined value.

Denies a group access request for the given user.

Examples:

Gitlab.deny_group_access_request(1, 1)

Parameters:

  • :group(required) (Integer, String)

    The ID or name of a group.

  • :user_id(required) (Integer)

    The user ID of the access requester



99
100
101
# File 'lib/gitlab/client/access_requests.rb', line 99

def deny_group_access_request(group, user_id)
  delete("/groups/#{url_encode group}/access_requests/#{user_id}")
end

#deny_project_access_request(project, user_id) ⇒ void

This method returns an undefined value.

Denies a project access request for the given user.

Examples:

Gitlab.deny_project_access_request(1, 1)

Parameters:

  • :project(required) (Integer, String)

    The ID or name of a project.

  • :user_id(required) (Integer)

    The user ID of the access requester



87
88
89
# File 'lib/gitlab/client/access_requests.rb', line 87

def deny_project_access_request(project, user_id)
  delete("/projects/#{url_encode project}/access_requests/#{user_id}")
end

#group_access_requests(group) ⇒ Array<Gitlab::ObjectifiedHash>

Gets a list of access requests for a group viewable by the authenticated user.

Examples:

Gitlab.group_access_requests(1)

Parameters:

  • :group(required) (Integer, String)

    The ID or name of a group.

Returns:



25
26
27
# File 'lib/gitlab/client/access_requests.rb', line 25

def group_access_requests(group)
  get("/groups/#{url_encode group}/access_requests")
end

#project_access_requests(project) ⇒ Array<Gitlab::ObjectifiedHash>

Gets a list of access requests for a project viewable by the authenticated user.

Examples:

Gitlab.project_access_requests(1)

Parameters:

  • :project(required) (Integer, String)

    The ID or name of a project.

Returns:



14
15
16
# File 'lib/gitlab/client/access_requests.rb', line 14

def project_access_requests(project)
  get("/projects/#{url_encode project}/access_requests")
end

#request_group_access(group) ⇒ Gitlab::ObjectifiedHash

Requests access for the authenticated user to a group.

Examples:

Gitlab.request_group_access(1)

Parameters:

  • :group(required) (Integer, String)

    The ID or name of a group.

Returns:



47
48
49
# File 'lib/gitlab/client/access_requests.rb', line 47

def request_group_access(group)
  post("/groups/#{url_encode group}/access_requests")
end

#request_project_access(project) ⇒ Gitlab::ObjectifiedHash

Requests access for the authenticated user to a project.

Examples:

Gitlab.request_project_access(1)

Parameters:

  • :project(required) (Integer, String)

    The ID or name of a project.

Returns:



36
37
38
# File 'lib/gitlab/client/access_requests.rb', line 36

def request_project_access(project)
  post("/projects/#{url_encode project}/access_requests")
end