Class: BrickFTP::RESTfulAPI::CreatePermission

Inherits:
Object
  • Object
show all
Includes:
Command
Defined in:
lib/brick_ftp/restful_api/create_permission.rb

Overview

Create a permission

Params

PARAMETER TYPE DESCRIPTION
user_id integer Unique identifier for the user being granted a permission. Each user is given an ID automatically upon creation. The user_id and group_id fields cannot both be set.
username string Username for the user, if user_id is set. If this value is set during creation and user_id is not set, the user_id is looked up from the username and set. Maximum of 50 characters.
group_id integer Unique identifier for the group being granted a permission. Each group is given an ID automatically upon creation. The user_id and group_id fields cannot both be set.
path string Folder path for the permission to apply to. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
permission enum Value must be set to full, readonly, writeonly, previewonly, or history, depending on the type of access to be granted by the Permission.
recursive boolean If set to false, the permission will be non-recursive, and will not apply to subfolders of the folder specified by the path property. Default is true.

Defined Under Namespace

Classes: Params

Instance Method Summary collapse

Methods included from Command

included, #initialize

Instance Method Details

#call(params) ⇒ BrickFTP::Types::Permission

Creates a new permission record.

Parameters:

Returns:



41
42
43
44
45
# File 'lib/brick_ftp/restful_api/create_permission.rb', line 41

def call(params)
  res = client.post('/api/rest/v1/permissions.json', params.to_h.compact)

  BrickFTP::Types::Permission.new(**res.symbolize_keys)
end