rac.install in Role Access Control 8
Same filename and directory in other branches
Implements hook_install()
File
rac.installView source
<?php
/**
* @file
* Implements hook_install()
*/
/**
* Install function to assign default permissions for role access.
*/
function rac_install() {
$ops = [
'view',
];
$roles = user_roles();
foreach ($ops as $op) {
foreach ($roles as $role) {
$permission = "RAC_" . $op . "_" . $role
->id();
$role
->grantPermission($permission);
$role
->save();
}
}
}
/**
* Add default config for new update_unpublished setting.
*/
function rac_update_8100($sandbox) {
\Drupal::service("config.factory")
->getEditable("rac.settings")
->set("update_unpublished", TRUE)
->save();
}
Functions
Name | Description |
---|---|
rac_install | Install function to assign default permissions for role access. |
rac_update_8100 | Add default config for new update_unpublished setting. |