function 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()
CommentBlockTest::testRecentCommentBlock in drupal/core/modules/comment/lib/Drupal/comment/Tests/CommentBlockTest.php
Tests the recent comments block.
ContactPersonalTest::testPersonalContactAccess in drupal/core/modules/contact/lib/Drupal/contact/Tests/ContactPersonalTest.php
Tests access to the personal contact form.
ContactSitewideTest::testSiteWideContact in drupal/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php
Tests configuration options and the site-wide contact form.
FileFieldWidgetTest::testPrivateFileComment in drupal/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php
Tests that download restrictions on private files work on comments.
NodeAdminTest::setUp in drupal/core/modules/node/lib/Drupal/node/Tests/NodeAdminTest.php
Sets up a Drupal site for running functional and integration tests.

... See full list

File

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