function user_role_revoke_permissions

user_role_revoke_permissions($rid, array $permissions = array())

Revoke permissions from a user role.

Parameters

$rid: The ID of a user role to alter.

$permissions: A list of permission names to revoke.

See also

user_role_change_permissions()

user_role_grant_permissions()

File

modules/user/user.module, line 3192
Enables the user registration and login system.

Code

function user_role_revoke_permissions($rid, array $permissions = array()) {
  // Revoke permissions for the role.
  db_delete('role_permission')
    ->condition('rid', $rid)
    ->condition('permission', $permissions, 'IN')
    ->execute();

  // Clear the user access cache.
  drupal_static_reset('user_access');
  drupal_static_reset('user_role_permissions');
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!user!user.module/function/user_role_revoke_permissions/7.x