function user_role_revoke_permissions

Same name in other branches
  1. 9 core/modules/user/user.module \user_role_revoke_permissions()
  2. 8.9.x core/modules/user/user.module \user_role_revoke_permissions()
  3. 10 core/modules/user/user.module \user_role_revoke_permissions()
  4. 11.x core/modules/user/user.module \user_role_revoke_permissions()

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()

6 calls to user_role_revoke_permissions()
CommentBlockFunctionalTest::testRecentCommentBlock in modules/comment/comment.test
Test the recent comments block.
ContactPersonalTestCase::testPersonalContactAccess in modules/contact/contact.test
Tests access to the personal contact form.
ContactSitewideTestCase::testSiteWideContact in modules/contact/contact.test
Tests configuration options and the site-wide contact form.
NodeAdminTestCase::setUp in modules/node/node.test
Sets up a Drupal site for running functional and integration tests.
TaxonomyPrivateFileTestCase::setUp in modules/taxonomy/taxonomy.test
Sets up a Drupal site for running functional and integration tests.

... See full list

File

modules/user/user.module, line 3234

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');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.