You are here

function lightning_layout_user_role_insert in Lightning Layout 8

Implements hook_ENTITY_TYPE_insert().

File

./lightning_layout.module, line 46
Contains layout functionality for Lightning.

Code

function lightning_layout_user_role_insert(RoleInterface $role) {

  // Don't do anything during config sync.
  if (\Drupal::isConfigSyncing()) {
    return;
  }
  elseif ($role
    ->id() == 'layout_manager' && Config::isBundled($role)) {
    $node_types = NodeType::loadMultiple();
    array_walk($node_types, 'lightning_layout_node_type_insert');
  }
}