Module: Slack::Web::Api::Endpoints::AppsPermissionsUsers

Included in:
Slack::Web::Api::Endpoints
Defined in:
lib/slack/web/api/endpoints/apps_permissions_users.rb

Instance Method Summary collapse

Instance Method Details

#apps_permissions_users_list(options = {}) ⇒ Object

Returns list of user grants and corresponding scopes this app has on a team.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :cursor (Object)

    Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request’s response_metadata. Default value fetches the first “page” of the collection. See pagination for more detail.

  • :limit (Object)

    The maximum number of items to return.

See Also:



18
19
20
21
22
23
24
25
26
# File 'lib/slack/web/api/endpoints/apps_permissions_users.rb', line 18

def apps_permissions_users_list(options = {})
  if block_given?
    Pagination::Cursor.new(self, :apps_permissions_users_list, options).each do |page|
      yield page
    end
  else
    post('apps.permissions.users.list', options)
  end
end

#apps_permissions_users_request(options = {}) ⇒ Object

Enables an app to trigger a permissions modal to grant an app access to a user access scope.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :scopes (Object)

    A comma separated list of user scopes to request for.

  • :trigger_id (Object)

    Token used to trigger the request.

  • :user (user)

    The user this scope is being requested for.

See Also:



39
40
41
42
43
44
45
# File 'lib/slack/web/api/endpoints/apps_permissions_users.rb', line 39

def apps_permissions_users_request(options = {})
  throw ArgumentError.new('Required arguments :scopes missing') if options[:scopes].nil?
  throw ArgumentError.new('Required arguments :trigger_id missing') if options[:trigger_id].nil?
  throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
  options = options.merge(user: users_id(options)['user']['id']) if options[:user]
  post('apps.permissions.users.request', options)
end