class DevelGeneratePermissions in Devel 8
Same name and namespace in other branches
- 8.3 devel_generate/src/DevelGeneratePermissions.php \Drupal\devel_generate\DevelGeneratePermissions
- 8.2 devel_generate/src/DevelGeneratePermissions.php \Drupal\devel_generate\DevelGeneratePermissions
- 4.x devel_generate/src/DevelGeneratePermissions.php \Drupal\devel_generate\DevelGeneratePermissions
Provides dynamic permissions of the filter module.
Hierarchy
- class \Drupal\devel_generate\DevelGeneratePermissions implements ContainerInjectionInterface
Expanded class hierarchy of DevelGeneratePermissions
File
- devel_generate/
src/ DevelGeneratePermissions.php, line 11
Namespace
Drupal\devel_generateView source
class DevelGeneratePermissions implements ContainerInjectionInterface {
/**
* The plugin manager.
*
* @var \Drupal\devel_generate\DevelGeneratePluginManager;
*/
protected $develGeneratePluginManager;
/**
* Constructs a new DevelGeneratePermissions instance.
*
* @param \Drupal\devel_generate\DevelGeneratePluginManager $develGeneratePluginManager
* The plugin manager.
*/
public function __construct(DevelGeneratePluginManager $develGeneratePluginManager) {
$this->develGeneratePluginManager = $develGeneratePluginManager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static($container
->get('plugin.manager.develgenerate'));
}
/*
* A permissions callback.
*
* @see devel_generate.permissions.yml.
*
* @return array
*/
function permissions() {
$devel_generate_plugins = $this->develGeneratePluginManager
->getDefinitions();
foreach ($devel_generate_plugins as $plugin) {
$permission = $plugin['permission'];
$permissions[$permission] = array(
'title' => t($permission),
);
}
// $permissions = array(
// 'administer devel_generate' => array(
// 'title' => t('Administer devel generate'),
// ),
// );
return $permissions;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DevelGeneratePermissions:: |
protected | property | The plugin manager. | |
DevelGeneratePermissions:: |
public static | function |
Instantiates a new instance of this class. Overrides ContainerInjectionInterface:: |
|
DevelGeneratePermissions:: |
function | |||
DevelGeneratePermissions:: |
public | function | Constructs a new DevelGeneratePermissions instance. |