RoleStorage.php 586 Bytes
Newer Older
1 2 3 4
<?php

/**
 * @file
5
 * Contains \Drupal\user\RoleStorage.
6 7 8 9
 */

namespace Drupal\user;

10
use Drupal\Core\Config\Entity\ConfigEntityStorage;
11 12 13 14

/**
 * Controller class for user roles.
 */
15
class RoleStorage extends ConfigEntityStorage implements RoleStorageInterface {
16

17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
  /**
   * {@inheritdoc}
   */
  public function isPermissionInRoles($permission, array $rids) {
    $has_permission = FALSE;
    foreach ($this->loadMultiple($rids) as $role) {
      if ($role->hasPermission($permission)) {
        $has_permission = TRUE;
        break;
      }
    }

    return $has_permission;
  }

32
}