Chris@0: isLocked())->addCacheableDependency($entity) Chris@0: ->andIf(parent::checkAccess($entity, $operation, $account)); Chris@0: Chris@0: case 'delete': Chris@0: /* @var \Drupal\Core\Language\LanguageInterface $entity */ Chris@0: return AccessResult::allowedIf(!$entity->isLocked())->addCacheableDependency($entity) Chris@0: ->andIf(AccessResult::allowedIf(!$entity->isDefault())->addCacheableDependency($entity)) Chris@0: ->andIf(parent::checkAccess($entity, $operation, $account)); Chris@0: Chris@0: default: Chris@0: // No opinion. Chris@0: return AccessResult::neutral(); Chris@0: } Chris@0: } Chris@0: Chris@0: }