getParentEntity() != NULL) { // Delete permission on the paragraph, should just depend on 'update' // access permissions on the parent. $operation = ($operation == 'delete') ? 'update' : $operation; $parent_access = $paragraph->getParentEntity()->access($operation, $account, TRUE); return AccessResult::allowedIf($operation != 'view' || $paragraph->status->value) ->andIf($parent_access); } return AccessResult::allowedIf($operation != 'view' || $paragraph->status->value); } /** * {@inheritdoc} */ protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) { // Allowed when nobody implements. return AccessResult::allowed(); } }