.../src/Functional/EntityResource/Shortcut/ShortcutResourceTestBase.php | 2 +- core/modules/shortcut/shortcut.module | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/modules/rest/tests/src/Functional/EntityResource/Shortcut/ShortcutResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/Shortcut/ShortcutResourceTestBase.php index c6e9195..fb8ebaa 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/Shortcut/ShortcutResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/Shortcut/ShortcutResourceTestBase.php @@ -149,7 +149,7 @@ protected function getExpectedUnauthorizedAccessMessage($method) { case 'POST': case 'PATCH': case 'DELETE': - return "The 'access shortcuts' AND 'customize shortcut links' permissions is required."; + return "The shortcut set must be the currently displayed set for the user and the user must have 'access shortcuts' AND 'customize shortcut links' permissions."; default: return parent::getExpectedUnauthorizedAccessMessage($method); diff --git a/core/modules/shortcut/shortcut.module b/core/modules/shortcut/shortcut.module index aa363fa..8ace7bd 100644 --- a/core/modules/shortcut/shortcut.module +++ b/core/modules/shortcut/shortcut.module @@ -67,7 +67,7 @@ function shortcut_set_edit_access(ShortcutSetInterface $shortcut_set = NULL) { $may_edit_current_shortcut_set = $account->hasPermission('customize shortcut links') && (!isset($shortcut_set) || $shortcut_set == shortcut_current_displayed_set()) && $account->hasPermission('access shortcuts'); $result = AccessResult::allowedIf($may_edit_current_shortcut_set)->cachePerPermissions(); if (!$result->isAllowed()) { - $result->setReason("The 'access shortcuts' AND 'customize shortcut links' permissions is required."); + $result->setReason("The shortcut set must be the currently displayed set for the user and the user must have 'access shortcuts' AND 'customize shortcut links' permissions."); } return $result; }