function RoleStorage::isPermissionInRoles
Returns whether a permission is in one of the passed in roles.
Parameters
string $permission: The permission.
array $rids: The list of role IDs to check.
Return value
bool TRUE is the permission is in at least one of the roles. FALSE otherwise.
Overrides RoleStorageInterface::isPermissionInRoles
File
- 
              core/modules/ user/ src/ RoleStorage.php, line 15 
Class
- RoleStorage
- Controller class for user roles.
Namespace
Drupal\userCode
public function isPermissionInRoles($permission, array $rids) {
  foreach ($this->loadMultiple($rids) as $role) {
    /** @var \Drupal\user\RoleInterface $role */
    if ($role->hasPermission($permission)) {
      return TRUE;
    }
  }
  return FALSE;
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
