Contents
Remove Capability - Plugixa Advanced User Role Editor
DELETE /plugixa-aure/v1/capabilities/{cap}
Take a capability off every role at once. Only for leftovers nothing declares and for names you added yourself, which also leave your list.
Needs the Edit roles permission: plugixa_aure_edit_roles.
Note. A name the site has never heard of is not reported as not found: unless you hold it, the answer is
403 plugixa_aure_cannot_revoke.
Request
DELETE https://your-site.example/wp-json/plugixa-aure/v1/capabilities/manage_old_forms
Path parameters
| Name | Type | Description |
|---|---|---|
cap |
string |
The capability. Lower-cased before use |
Responses
200 OK. The capability was removed.
{
"success": true,
"data": {
"capability": "manage_old_forms",
"removedFrom": [
"editor"
]
}
}
| Field | Type | Meaning |
|---|---|---|
data.capability |
string |
The capability |
data.removedFrom |
array |
Slugs of the roles it was removed from |
A restore point is taken first. Accounts that hold the capability directly keep it: only roles are cleaned.
Errors
| Status | Code | When |
|---|---|---|
409 |
plugixa_aure_capability_claimed |
It is one of this plugin’s own capabilities, or WordPress, a post type, a taxonomy or a plugin still declares it. |
409 |
plugixa_aure_capability_likely_owned |
It probably belongs to an installed plugin. |
403 |
plugixa_aure_cannot_revoke |
The change takes away, or blocks, a capability you do not hold yourself. |
Plus the errors every endpoint can return.
Examples
curl -s -X DELETE "https://your-site.example/wp-json/plugixa-aure/v1/capabilities/manage_old_forms" \
-u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-aure/v1/capabilities/manage_old_forms');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-aure/v1/capabilities/manage_old_forms', {
method: 'DELETE',
headers: {
'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
},
});
const { data } = await response.json();
Quick Links
Share