function DevelGeneratePermissions::permissions

Same name in other branches
  1. 4.x devel_generate/src/DevelGeneratePermissions.php \Drupal\devel_generate\DevelGeneratePermissions::permissions()

A permissions' callback.

Return value

array An array of permissions for all plugins.

See also

devel_generate.permissions.yml

1 string reference to 'DevelGeneratePermissions::permissions'
devel_generate.permissions.yml in devel_generate/devel_generate.permissions.yml
devel_generate/devel_generate.permissions.yml

File

devel_generate/src/DevelGeneratePermissions.php, line 40

Class

DevelGeneratePermissions
Provides dynamic permissions of the filter module.

Namespace

Drupal\devel_generate

Code

public function permissions() : array {
    $permissions = [];
    $devel_generate_plugins = $this->develGeneratePluginManager
        ->getDefinitions();
    foreach ($devel_generate_plugins as $plugin) {
        $permission = $plugin['permission'];
        $permissions[$permission] = [
            'title' => $this->t('@permission', [
                '@permission' => $permission,
            ]),
        ];
    }
    return $permissions;
}