f37acc06e0cdb46e0e6a6d937ee39a988d04a57f
[yaffs-website] / web / core / modules / user / src / RoleStorage.php
1 <?php
2
3 namespace Drupal\user;
4
5 use Drupal\Core\Config\Entity\ConfigEntityStorage;
6
7 /**
8  * Controller class for user roles.
9  */
10 class RoleStorage extends ConfigEntityStorage implements RoleStorageInterface {
11
12   /**
13    * {@inheritdoc}
14    */
15   public function isPermissionInRoles($permission, array $rids) {
16     $has_permission = FALSE;
17     foreach ($this->loadMultiple($rids) as $role) {
18       /** @var \Drupal\user\RoleInterface $role */
19       if ($role->isAdmin() || $role->hasPermission($permission)) {
20         $has_permission = TRUE;
21         break;
22       }
23     }
24
25     return $has_permission;
26   }
27
28 }