You are here

protected function GroupMenu::deleteAccess in Group Menu 8

Performs access check for the delete operation.

This method is supposed to be overwritten by extending classes that do their own custom access checking.

Parameters

\Drupal\group\Entity\GroupContentInterface $group_content: The group content for which to check access.

\Drupal\Core\Session\AccountInterface $account: The user for which to check access.

Return value

\Drupal\Core\Access\AccessResultInterface The access result.

Overrides GroupContentEnablerBase::deleteAccess

File

src/Plugin/GroupContentEnabler/GroupMenu.php, line 112

Class

GroupMenu
Provides a content enabler for nodes.

Namespace

Drupal\groupmenu\Plugin\GroupContentEnabler

Code

protected function deleteAccess(GroupContentInterface $group_content, AccountInterface $account) {
  $group = $group_content
    ->getGroup();
  $plugin_id = $this
    ->getPluginId();
  return GroupAccessResult::allowedIfHasGroupPermission($group, $account, "delete {$plugin_id} content");
}