function user_role_revoke_permissions

7.x user.module 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()

5 calls to user_role_revoke_permissions()
CommentBlockFunctionalTest::testRecentCommentBlock in drupal-7.x/modules/comment/comment.test
Test the recent comments block.
ContactPersonalTestCase::testPersonalContactAccess in drupal-7.x/modules/contact/contact.test
Tests access to the personal contact form.
ContactSitewideTestCase::testSiteWideContact in drupal-7.x/modules/contact/contact.test
Tests configuration options and the site-wide contact form.
NodeAdminTestCase::setUp in drupal-7.x/modules/node/node.test
Sets up a Drupal site for running functional and integration tests.
user_role_change_permissions in drupal-7.x/modules/user/user.module
Change permissions for a user role.

File

drupal-7.x/modules/user/user.module, line 3132
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');
}