You are here

function environment_indicator_permission in Environment Indicator 8.2

Same name and namespace in other branches
  1. 7.2 environment_indicator.module \environment_indicator_permission()
  2. 7 environment_indicator.module \environment_indicator_permission()

Implements hook_permission().

File

./environment_indicator.module, line 82
Module implementation file.

Code

function environment_indicator_permission() {
  $permissons = array(
    'administer environment indicator settings' => array(
      'title' => t('Administer environment_indicator settings'),
      'description' => t('Configure the environments and the colors to display.'),
    ),
    'access environment indicator' => array(
      'title' => t('See environment indicator'),
      'description' => t('See all the environment indicators in the site.'),
    ),
  );
  $environments = environment_indicator_get_all();
  foreach ($environments as $machine => $environment) {
    $permissons['access environment indicator ' . $environment->machine] = array(
      'title' => t('See environment indicator for %name', array(
        '%name' => $environment->name,
      )),
      'description' => t('See the evironment indicator if the user is in the %name environment.', array(
        '%name' => $environment->name,
      )),
    );
  }
  return $permissons;
}