3 namespace Drupal\environment_indicator;
5 class EnvironmentIndicatorPermissions {
8 * Returns the dynamic permissions array.
11 * The permissions configuration array.
13 public function permissions() {
15 // TODO: Learn how to inject the EntityConfig loader.
16 // $environments = environment_indicator_get_all();
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]),