RoleStorage.php in Drupal 9
File
core/modules/user/src/RoleStorage.php
View source
<?php
namespace Drupal\user;
use Drupal\Core\Config\Entity\ConfigEntityStorage;
class RoleStorage extends ConfigEntityStorage implements RoleStorageInterface {
public function isPermissionInRoles($permission, array $rids) {
$has_permission = FALSE;
foreach ($this
->loadMultiple($rids) as $role) {
if ($role
->isAdmin() || $role
->hasPermission($permission)) {
$has_permission = TRUE;
break;
}
}
return $has_permission;
}
}