class ToolbarMenuPermissions in Toolbar Menu 8
Same name and namespace in other branches
- 8.2 src/ToolbarMenuPermissions.php \Drupal\toolbar_menu\ToolbarMenuPermissions
Provides dynamic permissions of the toolbar_menu module.
Hierarchy
- class \Drupal\toolbar_menu\ToolbarMenuPermissions implements ContainerInjectionInterface
Expanded class hierarchy of ToolbarMenuPermissions
File
- src/
ToolbarMenuPermissions.php, line 11
Namespace
Drupal\toolbar_menuView source
class ToolbarMenuPermissions implements ContainerInjectionInterface {
/**
* The toolbar menu manager.
*
* @var \Drupal\toolbar_menu\ToolbarMenuManager
*/
protected $toolbarMenuManager;
/**
* Constructs a new ToolbarMenuPermissions instance.
*
* @param \Drupal\toolbar_menu\ToolbarMenuManager $toolbar_menu
* The toolbar menu manager.
*/
public function __construct(ToolbarMenuManager $toolbar_menu) {
$this->toolbarMenuManager = $toolbar_menu;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static($container
->get('toolbar_menu.manager'));
}
/**
* Returns an array of toolbar_menu permissions.
*
* @return array
* The permission list.
*/
public function permissions() {
return $this->toolbarMenuManager
->getPermissionList();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ToolbarMenuPermissions:: |
protected | property | The toolbar menu manager. | |
ToolbarMenuPermissions:: |
public static | function |
Instantiates a new instance of this class. Overrides ContainerInjectionInterface:: |
|
ToolbarMenuPermissions:: |
public | function | Returns an array of toolbar_menu permissions. | |
ToolbarMenuPermissions:: |
public | function | Constructs a new ToolbarMenuPermissions instance. |