protected function GroupAccessControlHandler::checkAccess in RNG - Events and Registrations 8
Same name and namespace in other branches
- 8.2 src/AccessControl/GroupAccessControlHandler.php \Drupal\rng\AccessControl\GroupAccessControlHandler::checkAccess()
- 3.x src/AccessControl/GroupAccessControlHandler.php \Drupal\rng\AccessControl\GroupAccessControlHandler::checkAccess()
Parameters
\Drupal\rng\GroupInterface $entity: A group entity.
Overrides EntityAccessControlHandler::checkAccess
File
- src/
AccessControl/ GroupAccessControlHandler.php, line 21
Class
- GroupAccessControlHandler
- Access controller for groups.
Namespace
Drupal\rng\AccessControlCode
protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
$account = $this
->prepareUser($account);
$event = $entity
->getEvent();
if (!$entity
->isUserGenerated() && $operation == 'delete') {
return AccessResult::forbidden();
}
if ($event) {
return $event
->access('manage event', $account, TRUE);
}
return AccessResult::neutral();
}