cc-1.0.x-dev/modules/cc_cex/cc_cex.install

modules/cc_cex/cc_cex.install
<?php

/**
 * @file
 * Install, update and uninstall functions for the CC module.
 */

/**
 * Implements hook_install().
 */
function cc_install() {
  // Grant the "administer cc exchange settings" permission to the administrator role.
  $roles = \Drupal::entityTypeManager()->getStorage('user_role')->loadMultiple();
  if (isset($roles['administrator'])) {
    $roles['administrator']->grantPermission('administer cc exchange settings');
    $roles['administrator']->save();
  }
}

/**
 * Implements hook_uninstall().
 */
function cc_uninstall() {
  // Delete the CC selection view.
  if ($view = \Drupal::entityTypeManager()->getStorage('view')->load('cc_selection')) {
    $view->delete();
  }
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc