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:


68
69
70
# File 'lib/gitlab/client/access_requests.rb', line 68

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:


55
56
57
# File 'lib/gitlab/client/access_requests.rb', line 55

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


90
91
92
# File 'lib/gitlab/client/access_requests.rb', line 90

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


79
80
81
# File 'lib/gitlab/client/access_requests.rb', line 79

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:


22
23
24
# File 'lib/gitlab/client/access_requests.rb', line 22

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:


12
13
14
# File 'lib/gitlab/client/access_requests.rb', line 12

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:


42
43
44
# File 'lib/gitlab/client/access_requests.rb', line 42

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:


32
33
34
# File 'lib/gitlab/client/access_requests.rb', line 32

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