class EnvironmentIndicatorPermissions in Environment Indicator 8.3
Same name and namespace in other branches
- 4.x src/EnvironmentIndicatorPermissions.php \Drupal\environment_indicator\EnvironmentIndicatorPermissions
Undocumented class.
Hierarchy
- class \Drupal\environment_indicator\EnvironmentIndicatorPermissions uses StringTranslationTrait
Expanded class hierarchy of EnvironmentIndicatorPermissions
File
- src/
EnvironmentIndicatorPermissions.php, line 10
Namespace
Drupal\environment_indicatorView source
class EnvironmentIndicatorPermissions {
use StringTranslationTrait;
/**
* Returns the dynamic permissions array.
*
* @return array
* The permissions configuration array.
*/
public function permissions() {
$permissions = [];
// TODO: Learn how to inject the EntityConfig loader.
$environments = [];
foreach ($environments as $machine => $environment) {
$permissions['access environment indicator ' . $environment->machine] = [
'title' => $this
->t('See environment indicator for %name', [
'%name' => $environment->name,
]),
'description' => $this
->t('See the environment indicator if the user is in the %name environment.', [
'%name' => $environment->name,
]),
];
}
return $permissions;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EnvironmentIndicatorPermissions:: |
public | function | Returns the dynamic permissions array. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |