X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fsystem%2Fsrc%2FMenuAccessControlHandler.php;fp=web%2Fcore%2Fmodules%2Fsystem%2Fsrc%2FMenuAccessControlHandler.php;h=86d7db135e00f237444e887ef9ee45b200c2092d;hp=034f45a062fad3318335b5dfbd0ecbaaa8eb1376;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/web/core/modules/system/src/MenuAccessControlHandler.php b/web/core/modules/system/src/MenuAccessControlHandler.php index 034f45a06..86d7db135 100644 --- a/web/core/modules/system/src/MenuAccessControlHandler.php +++ b/web/core/modules/system/src/MenuAccessControlHandler.php @@ -14,17 +14,23 @@ use Drupal\Core\Session\AccountInterface; */ class MenuAccessControlHandler extends EntityAccessControlHandler { + /** + * {@inheritdoc} + */ + protected $viewLabelOperation = TRUE; + /** * {@inheritdoc} */ protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) { - if ($operation === 'view') { + // There are no restrictions on viewing the label of a date format. + if ($operation === 'view label') { return AccessResult::allowed(); } // Locked menus could not be deleted. - elseif ($operation == 'delete') { + elseif ($operation === 'delete') { if ($entity->isLocked()) { - return AccessResult::forbidden()->addCacheableDependency($entity); + return AccessResult::forbidden('The Menu config entity is locked.')->addCacheableDependency($entity); } else { return parent::checkAccess($entity, $operation, $account)->addCacheableDependency($entity);