Remove a Permission from a Role
Remove a permission from a 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 Delete Warrant endpoint instead.
Endpoint
DELETE /v1/roles/:roleId/permissions/:permissionId
Parameters
Parameter | Description | Type | Required |
---|---|---|---|
roleId | The roleId of the role you want to remove a permission from. | URL param | yes |
permissionId | The permissionId of the permission you want to remove from a role. | URL param | yes |
Request
- cURL
- Go
- Java
- Node.js
- Python
- Ruby
- PHP
- CLI
curl "https://api.warrant.dev/v1/roles/admin/permissions/create-report" \
-X DELETE \
-H "Authorization: ApiKey YOUR_KEY"
wookie, err := permission.RemovePermissionFromRole("create-report", "admin")
if err != nil {
// handle error
}
try {
client.removePermissionFromRole("create-report", "admin");
} catch (WarrantException e) {
// Handle error
}
// Class method
await warrantClient.Permission.removePermissionFromRole(
"admin",
"create-report"
);
// Instance method
const role = await warrantClient.Role.get("admin");
await role.removePermission("create-report");
# Class method
warrant.Permission.remove_from_role("admin", "create-report")
# Instance method
role = warrant.Role.get("admin")
role.remove_permission("create-report")
# Class method
Warrant::Permission.remove_from_role("admin", "create-report")
# Instance method
role = Warrant::Role.get("admin")
role.remove_permission("create-report")
$warrant->removePermissionFromRole("admin", "create-report");
warrant remove permission:create-report role:admin
Response
200 OK