Get Permissions for Role
Get all permissions assigned directly to a specific role
.
caution
This endpoint has been deprecated and will be phased out at the end of 2023. Please update any existing usages of it to use the Query endpoint instead.
Endpoint
GET /v1/roles/:roleId/permissions
Request
- cURL
- Go
- Java
- Node.js
- Python
- Ruby
- PHP
curl "https://api.warrant.dev/v1/roles/admin/permissions" \
-H "Authorization: ApiKey YOUR_KEY"
rolePermissions, err := permission.ListPermissionsForRole("admin", &warrant.ListPermissionParams{})
if err != nil {
// handle error
}
int limit = 100;
int page = 1;
Permission[] permissions = client.listPermissionsForRole("admin", limit, page);
// Class method
const permissions = await warrantClient.Permission.listPermissionsForRole(
"admin"
);
// Instance method
const role = warrantClient.Role.get("admin");
const permissions = await role.listPermissions();
# Class method
role_permissions = warrant.Permission.list_for_role("admin")
# Instance method
role = warrant.Role.get("admin")
role_permissions = role.list_permissions()
Response
[
{
"permissionId": "create-report"
}
]