Documentation
IPS_DeleteRole
bool IPS_DeleteRole (string $Role)
Parameters
| Role | Name of the role to be deleted |
Returns
If the function succeeds, it returns TRUE, otherwise FALSE.
Description
The function deletes the role with the name Role together with its permissions. The role is automatically removed from all users it was assigned to – they lose all permissions they only had through this role.
If the role does not exist, the function fails with "Role with name '…' does not exist". The role @admin cannot be deleted ("Role @admin cannot be deleted!").
The executing user must be an administrator (see IPS_IsAdministrator), otherwise the function fails with "Administrator permissions are required for this action!".
Role management is only available with a license that includes the RBAC feature. Otherwise the function fails with "This function is only available for licenses with the RBAC feature enabled!". If more users exist than the license allows, the function fails with "Your license is currently limited to … users. Please consider upgrading the license to more users!".
Example
if (IPS_RoleExists('Residents')) {
IPS_DeleteRole('Residents');
}