Mercurial > hg > isophonics-drupal-site
comparison core/modules/block_content/src/BlockContentAccessControlHandler.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | 4c8ae668cc8c |
children | 129ea1e6d783 |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
17 /** | 17 /** |
18 * {@inheritdoc} | 18 * {@inheritdoc} |
19 */ | 19 */ |
20 protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) { | 20 protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) { |
21 if ($operation === 'view') { | 21 if ($operation === 'view') { |
22 return AccessResult::allowed(); | 22 return AccessResult::allowedIf($entity->isPublished())->addCacheableDependency($entity) |
23 ->orIf(AccessResult::allowedIfHasPermission($account, 'administer blocks')); | |
23 } | 24 } |
24 return parent::checkAccess($entity, $operation, $account); | 25 return parent::checkAccess($entity, $operation, $account); |
25 } | 26 } |
26 | 27 |
27 } | 28 } |