Method: Code42::API::Role#assign_role

Defined in:
lib/code42/api/role.rb

#assign_role(attrs = {}) ⇒ Code42::Role

Assigns a role to a user

Examples:

client.assign_role(:user_id => 2, :role_name => 'Admin')

Parameters:

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

    A hash of attributes for assigning a user role

Returns:



11
12
13
# File 'lib/code42/api/role.rb', line 11

def assign_role(attrs = {})
  object_from_response(Code42::Role, :post, 'UserRole', attrs)
end