You are here

editoria11y.install in Editoria11y Accessibility Checker 1.0.x

Same filename and directory in other branches
  1. 7 editoria11y.install

Editorially install file.

File

editoria11y.install
View source
<?php

/**
 * @file
 * Editorially install file.
 */
use Drupal\user\Entity\Role;

/**
 * Implements hook_install().
 */
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();
    }
  }
}

Functions

Namesort descending Description
editoria11y_install Implements hook_install().