You are here

private function EntityConfigSettingsForm::getRestrictedRoles in Acquia Content Hub 8

Get roles with security implications.

Return value

array An array of admin roles and roles with restrict access flag set for any of role permission.

1 call to EntityConfigSettingsForm::getRestrictedRoles()
EntityConfigSettingsForm::buildUserRoleWarningForm in src/Form/EntityConfigSettingsForm.php
Build user role form warning.

File

src/Form/EntityConfigSettingsForm.php, line 346

Class

EntityConfigSettingsForm
Defines the form to configure the entity types and bundles to be exported.

Namespace

Drupal\acquia_contenthub\Form

Code

private function getRestrictedRoles() {
  $admin_roles = [];
  $permissions = $this->permissionHandler
    ->getPermissions();
  foreach ($this
    ->getRoles() as $role_name => $role) {
    if ($role
      ->isAdmin()) {
      $admin_roles[$role_name] = $role
        ->label();
    }
    else {
      foreach ($role
        ->getPermissions() as $permission_name) {
        if (!empty($permissions[$permission_name]['restrict access'])) {
          $admin_roles[$role_name] = $role
            ->label();
          continue;
        }
      }
    }
  }
  return $admin_roles;
}