You are here

function opigno_module_install in Opigno module 8

Same name and namespace in other branches
  1. 3.x opigno_module.install \opigno_module_install()

Implements hook_install().

File

./opigno_module.install, line 274
Opigno module app install/update functionality.

Code

function opigno_module_install() {

  // Give an access to specific Opigno module permissions.
  $role = Role::load(RoleInterface::AUTHENTICATED_ID);
  $issueAccessPermissions = [
    'view published module entities',
    'access editor',
  ];
  foreach ($issueAccessPermissions as $permission) {
    $role
      ->grantPermission($permission);
  }
  $role
    ->save();
  $not_recommended = ModuleH5PAdminSettingsForm::disabledByDefault();
  $config = \Drupal::service('config.factory')
    ->getEditable('opigno_module.settings');
  $config
    ->set('disabled_h5p', array_values($not_recommended));
  $config
    ->save();
}