entityType->getAdminPermission(); switch ($operation) { case 'view': case 'view revision': return AccessResult::allowedIfHasPermission($account, 'view fixity checks')->cachePerPermissions(); case 'update': case 'delete': return AccessResult::allowedIfHasPermission($account, $admin_permission)->cachePerPermissions(); case 'delete revision': // Not possible to delete the default revision, instead the user // should delete the actual entity. if ($entity->isDefaultRevision()) { return AccessResult::forbidden()->addCacheableDependency($entity); } return AccessResult::allowedIfHasPermission($account, $admin_permission)->cachePerPermissions(); default: return AccessResult::forbidden()->cachePerPermissions(); } } /** * {@inheritdoc} */ protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) { return AccessResult::allowedIfHasPermission($account, $this->entityType->getAdminPermission()); } }