You are here

function editoria11y_install in Editoria11y Accessibility Checker 1.0.x

Implements hook_install().

File

./editoria11y.install, line 13
Editorially install file.

Code

function editoria11y_install() {

  // Assign default access to roles likely to have content editing access.

  /** @var \Drupal\user\RoleInterface $role */
  foreach (Role::loadMultiple() as $role) {
    if ($role
      ->hasPermission('view own unpublished content') || $role
      ->hasPermission('access content overview') || $role
      ->hasPermission('access in place editing')) {
      $role
        ->grantPermission('view editoria11y checker');
      $role
        ->save();
    }
  }
}