Class: BrickFTP::RESTfulAPI::ListPermissions
- Inherits:
-
Object
- Object
- BrickFTP::RESTfulAPI::ListPermissions
- Includes:
- Command
- Defined in:
- lib/brick_ftp/restful_api/list_permissions.rb
Overview
List permissions
Params
PARAMETER | TYPE | DESCRIPTION |
---|---|---|
path | string | Optional path to focus the result set on. |
Instance Method Summary collapse
-
#call(path: nil) ⇒ Array<BrickFTP::Types::Permission>
Returns a list of permissions on the current site.
Methods included from Command
Instance Method Details
#call(path: nil) ⇒ Array<BrickFTP::Types::Permission>
Returns a list of permissions on the current site.
- By default all permissions for the entire site are returned.
- When given a path parameter, then only permissions immediately relevant to the given path are returned.
- When using a path parameter, the result will include permissions on the current path and recursive permissions that are inherited from parent paths, except that lesser permissions will be excluded if a greater permission applies on the given path for a particular user or group.
33 34 35 36 37 38 39 |
# File 'lib/brick_ftp/restful_api/list_permissions.rb', line 33 def call(path: nil) endpoint = '/api/rest/v1/permissions.json' endpoint = "#{endpoint}?path=#{ERB::Util.url_encode(path)}" unless path.nil? res = client.get(endpoint) res.map { |i| BrickFTP::Types::Permission.new(**i.symbolize_keys) } end |