You are here

legal.install in Legal 8

Installation and update functions for the Legal module.

File

legal.install
View source
<?php

/**
 * @file
 * Installation and update functions for the Legal module.
 */
use Drupal\user\RoleInterface;

/**
 * Implements hook_install().
 */
function legal_install() {

  // Set 'view Terms and Conditions' permission to enabled by default.
  if (\Drupal::moduleHandler()
    ->moduleExists('user')) {
    user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, [
      'view Terms and Conditions',
    ]);
    user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, [
      'view Terms and Conditions',
    ]);
  }
}

/**
 * Implements hook_update_last_removed().
 */
function legal_update_last_removed() {
  return 7103;
}

Functions