class OgMenuEventSubscriber in Organic Groups Menu (OG Menu) 8
Event subscribers for OG Menu.
Hierarchy
- class \Drupal\og_menu\EventSubscriber\OgMenuEventSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
Expanded class hierarchy of OgMenuEventSubscriber
1 string reference to 'OgMenuEventSubscriber'
1 service uses OgMenuEventSubscriber
File
- src/
EventSubscriber/ OgMenuEventSubscriber.php, line 13
Namespace
Drupal\og_menu\EventSubscriberView source
class OgMenuEventSubscriber implements EventSubscriberInterface {
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
return [
PermissionEventInterface::EVENT_NAME => [
[
'provideDefaultOgPermissions',
],
],
];
}
/**
* Provides default OG permissions.
*
* @param \Drupal\og\Event\PermissionEventInterface $event
* The OG permission event.
*/
public function provideDefaultOgPermissions(PermissionEventInterface $event) {
// @todo Make granular per OG Menu instance.
$event
->setPermissions([
new GroupPermission([
'name' => 'add new links to og menu instance entities',
'title' => t('Add new links to OG Menu instance entities'),
'default roles' => [
OgRoleInterface::ADMINISTRATOR,
],
]),
]);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
OgMenuEventSubscriber:: |
public static | function | Returns an array of event names this subscriber wants to listen to. | |
OgMenuEventSubscriber:: |
public | function | Provides default OG permissions. |