RolesResource


Create a role


To create an Abiquo role associated with an LDAP role, include the externalRoles attribute, which is a comma separated list of external role names.

POST https://example.com/api/admin/roles

Roles : [ROLE_USERS_MANAGE_ROLES]

Content-Type : role Accept : role

Error Codes

  • EN-0 - The requested enterprise does not exist
  • ROLE-15 - Role name cannot exceed 40 chars

Example

List roles


GET https://example.com/api/admin/roles

Roles : [ROLE_AUTHENTICATED, ROLE_USERS_MANAGE_ROLES, ROLE_USERS_VIEW_PRIVILEGES, ROLE_USERS_VIEW]

Parameter Type Default Value Description
identerprise Integer If present, filter by enterprise identifier
startwith Integer 0 The first element to be retrieved of the filtered search
by String name Order by
has String If present filter to apply in the search.
limit Integer 25 The number of entities to retrieve
asc Boolean true If the value of the 'by' parameter must be sorted in ascending order (true) or descending order (false)

Accept : roles

Example

Delete a role


DELETE https://example.com/api/admin/roles/{role}

Roles : [ROLE_USERS_MANAGE_ROLES]

Example

Get a role


GET https://example.com/api/admin/roles/{role}

Roles : [ROLE_AUTHENTICATED, ROLE_USERS_MANAGE_ROLES, ROLE_USERS_VIEW]

Accept : role

Error Codes

  • ROLE-0 - The requested role does not exist

Example

Update a role


PUT https://example.com/api/admin/roles/{role}

Roles : [ROLE_USERS_MANAGE_ROLES]

Content-Type : role Accept : role

Error Codes

  • EN-0 - The requested enterprise does not exist
  • ROLE-0 - The requested role does not exist
  • ROLE-10 - Cannot modify the enterprise of this role because it is currently assigned to users of that enterprise.
  • ROLE-15 - Role name cannot exceed 40 chars

Example

List privilege links of a role


GET https://example.com/api/admin/roles/{role}/action/privileges

Roles : [ROLE_AUTHENTICATED, ROLE_USERS_VIEW_PRIVILEGES, ROLE_USERS_VIEW]

Accept : links

Example

List privileges of a role


GET https://example.com/api/admin/roles/{role}/action/privileges

Roles : [ROLE_AUTHENTICATED, ROLE_USERS_VIEW_PRIVILEGES, ROLE_USERS_VIEW]

Accept : privileges