user_role_revoke_permissions($rid, array $permissions = array())
Revoke permissions from a user role.
Parameters
mixed $rid: The ID of a user role to alter.
array $permissions: (optional) A list of permission names to revoke.
See also
user_role_change_permissions()
File
- core/modules/user/user.module, line 1160
- Enables the user registration and login system.
Code
function user_role_revoke_permissions($rid, array $permissions = array()) { // Revoke permissions for the role. $role = Role::load($rid); foreach ($permissions as $permission) { $role->revokePermission($permission); } $role->trustData()->save(); }
Please login to continue.