Remove a Permission from a User
Remove a permission from a user.
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/users/:userId/permissions/:permissionId
Parameters
Parameter | Description | Type | Required |
---|---|---|---|
userId | The userId of the user 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/users/j7234nd09sd/permissions/create-report" \
-X DELETE \
-H "Authorization: ApiKey YOUR_KEY"
wookie, err := permission.RemovePermissionFromUser("create-report", "j7234nd09sd")
if err != nil {
// handle error
}
try {
client.removePermissionFromUser("create-report", "j7234nd09sd");
} catch (WarrantException e) {
// Handle error
}
// Class method
await warrantClient.User.removePermissionFromUser(
"j7234nd09sd",
"create-report"
);
// Instance method
const user = await warrantClient.User.get("j7234nd09sd");
await user.removePermission("create-report");
# Class method
warrant.Permission.remove_from_user("j7234nd09sd", "create-report")
# Instance method
user = warrant.User.get("j7234nd09sd")
user.remove_permission("create-report")
# Class method
Warrant::Permission.remove_from_user("j7234nd09sd", "create-report")
# Instance method
user = Warrant::User.get("j7234nd09sd")
user.remove_permission("create-report")
$warrant->removePermissionFromUser("j7234nd09sd", "create-report");
warrant remove permission:create-report user:j7234nd09sd
Response
200 OK