You are here

function user_role_revoke_permissions in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/user/user.module \user_role_revoke_permissions()

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

user_role_grant_permissions()

8 calls to user_role_revoke_permissions()
CommentAnonymousTest::testAnonymous in core/modules/comment/src/Tests/CommentAnonymousTest.php
Tests anonymous comment functionality.
CommentBlockTest::testRecentCommentBlock in core/modules/comment/src/Tests/CommentBlockTest.php
Tests the recent comments block.
ContactPersonalTest::testPersonalContactAccess in core/modules/contact/src/Tests/ContactPersonalTest.php
Tests access to the personal contact form.
ContactSitewideTest::testSiteWideContact in core/modules/contact/src/Tests/ContactSitewideTest.php
Tests configuration options and the site-wide contact form.
FileFieldWidgetTest::testPrivateFileComment in core/modules/file/src/Tests/FileFieldWidgetTest.php
Tests that download restrictions on private files work on comments.

... See full list

File

core/modules/user/user.module, line 1158
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();
}