public function ThemePerm::dynamicPermissions in Theme permission 8
Returns an array of permissions.
Return value
array The permissions.
1 string reference to 'ThemePerm::dynamicPermissions'
File
- src/
ThemePerm.php, line 53
Class
- ThemePerm
- Theme Permission.
Namespace
Drupal\theme_permissionCode
public function dynamicPermissions() {
$perms = [];
$themes = $this->themeHandler
->listInfo();
foreach ($themes as $theme => $value) {
$type_params = [
'%themename' => $theme,
];
$perms += [
"administer themes {$theme}" => [
'title' => $this
->t('administer themes %themename', $type_params),
],
"uninstall themes {$theme}" => [
'title' => $this
->t('uninstall themes %themename', $type_params),
],
"Edit Administration theme" => [
'title' => $this
->t('Edit Administration theme'),
],
];
}
return $perms;
}