You are here

function groupmenu_entity_access in Group Menu 8

Implements hook_entity_access().

When trying to view, update or delete a menu it suffices to have the right to do so in only one group the menu belongs to.

File

./groupmenu.module, line 45
Gives the ability to create and manage menus for groups.

Code

function groupmenu_entity_access(EntityInterface $entity, $op, AccountInterface $account) {
  if (!$entity instanceof MenuInterface) {
    return AccessResult::neutral();
  }
  return \Drupal::service('groupmenu.menu')
    ->menuAccess($op, $entity, $account);
}