Permissions
Read the API Overview to get started and learn more.
Grant permission
Grants a permission to an user or role. The user/role is specified by which field (user_id or role_id) is set.
Request body
Field | Type | Description |
---|---|---|
permission | string | The name of the permission. Must be one of bnders permissions |
user_id (optional) | string | Id of the user that should get the permission granted |
role_id (optional) | string | Id of the role that should get the permission granted |
project_id (optional) | string | Id of the project the permission should be scoped to |
Response body -
Returns a 204 status
Revoke permission
Revokes a permission from an user or role. The user/role is specified by which field (user_id or role_id) is set.
Request body
Field | Type | Description |
---|---|---|
permission | string | The name of the permission. Must be one of bnders permissions |
user_id (optional) | string | Id of the user that should get the permission revoked |
role_id (optional) | string | Id of the role that should get the permission revoked |
project_id (optional) | string | Id of the project the permission should be scoped to |
Response body -
Returns a 204 status
Apply permission preset
Applies a permission preset to an user or role (decided by the user_id or role_id field).
Request body
Field | Type | Description |
---|---|---|
preset | string | Name of the preset |
user_id (optional) | string | Id of the user that should get the preset applied |
role_id (optional) | string | Id of the role that should get the preset applied |
project_id (optional) | string | Id of the project the permissions should be scoped to |
Response body -
Returns a 204 status
Get a users permissions
Returns all permissions a user has.
Request body -
Response body
Field | Type | Description |
---|---|---|
globalPermissions | Map<Permission, boolean> | The permissions granted or revoked on a global scope |
projectPermissions | Map<String, Map<Permission, boolean>> | The permissions granted or revoked on a specific project |
discordPermissions | string | The discord permissions of the user |
Returns a 200 status
Get a roles permissions
Returns all permissions a role has.
Request body -
Response body
Field | Type | Description |
---|---|---|
globalPermissions | Map<Permission, boolean> | The permissions granted or revoked on a global scope |
projectPermissions | Map<String, Map<Permission, boolean>> | The permissions granted or revoked on a specific project |
discordPermissions | string | The discord permissions of the role |
Returns a 200 status