menu_item_role_access.install in Menu Item Role Access 8.2
Same filename and directory in other branches
Installation and update hooks for the menu item role access module.
File
menu_item_role_access.installView source
<?php
/**
* @file
* Installation and update hooks for the menu item role access module.
*/
/**
* Install the default configuration for this module.
*
* At this point no config exists for this module so we can safely install all
* of its config.
*/
function menu_item_role_access_update_8001() {
// Since no config yet exists for this module we can install the entire config
// directory.
\Drupal::service('config.installer')
->installDefaultConfig('module', 'menu_item_role_access');
}
/**
* Apply the entity definition updates.
*
* @throws \Drupal\Core\Entity\EntityStorageException
*/
function menu_item_role_access_update_8002() {
$config = \Drupal::configFactory()
->getEditable('menu_item_role_access.config');
$config
->set('overwrite_internal_link_target_access', $config
->get('overwrite_internal_link_target_access') ?? FALSE)
->save();
$config
->set('inherit_parent_access', $config
->get('inherit_parent_access') ?? FALSE)
->save();
}
Functions
Name | Description |
---|---|
menu_item_role_access_update_8001 | Install the default configuration for this module. |
menu_item_role_access_update_8002 | Apply the entity definition updates. |