public function GroupPermission::__construct in Group 8
Same name and namespace in other branches
- 2.0.x src/Plugin/views/access/GroupPermission.php \Drupal\group\Plugin\views\access\GroupPermission::__construct()
Constructs a Permission object.
Parameters
array $configuration: A configuration array containing information about the plugin instance.
string $plugin_id: The plugin_id for the plugin instance.
mixed $plugin_definition: The plugin implementation definition.
\Drupal\group\Access\GroupPermissionHandlerInterface $permission_handler: The group permission handler.
\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.
\Drupal\Core\Plugin\Context\ContextProviderInterface $context_provider: The group route context.
Overrides PluginBase::__construct
File
- src/
Plugin/ views/ access/ GroupPermission.php, line 78
Class
- GroupPermission
- Access plugin that provides group permission-based access control.
Namespace
Drupal\group\Plugin\views\accessCode
public function __construct(array $configuration, $plugin_id, $plugin_definition, GroupPermissionHandlerInterface $permission_handler, ModuleHandlerInterface $module_handler, ContextProviderInterface $context_provider) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->permissionHandler = $permission_handler;
$this->moduleHandler = $module_handler;
$contexts = $context_provider
->getRuntimeContexts([
'group',
]);
$this->context = $contexts['group'];
$this->group = $this->context
->getContextValue();
}