48fbce5ea21473d773e5ef6635171c8a7e0bfb94
[yaffs-website] / web / modules / contrib / environment_indicator / src / EnvironmentIndicatorPermissions.php
1 <?php
2
3 namespace Drupal\environment_indicator;
4
5 class EnvironmentIndicatorPermissions {
6
7   /**
8    * Returns the dynamic permissions array.
9    *
10    * @return array
11    *   The permissions configuration array.
12    */
13   public function permissions() {
14     $permissions = [];
15     // TODO: Learn how to inject the EntityConfig loader.
16     // $environments = environment_indicator_get_all();
17     $environments = [];
18     foreach ($environments as $machine => $environment) {
19       $permissions['access environment indicator ' . $environment->machine] = [
20         'title' => t('See environment indicator for %name', ['%name' => $environment->name]),
21         'description' => t('See the environment indicator if the user is in the %name environment.', ['%name' => $environment->name]),
22       ];
23     }
24     return $permissions;
25   }
26 }