Skip to content
Snippets Groups Projects
Commit 7df39b5d authored by catch's avatar catch
Browse files

Issue #3192292 by amateescu, daffie: Users with the 'administer workspaces'...

Issue #3192292 by amateescu, daffie: Users with the 'administer workspaces' permission can not create a workspace
parent 77480bee
No related branches found
No related tags found
6 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!1012Issue #3226887: Hreflang on non-canonical content pages,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10,!596Issue #3046532: deleting an entity reference field, used in a contextual view, makes the whole site unrecoverable,!496Issue #2463967: Use .user.ini file for PHP settings,!16Draft: Resolve #2081585 "History storage"
......@@ -50,7 +50,7 @@ protected function checkAccess(EntityInterface $entity, $operation, AccountInter
* {@inheritdoc}
*/
protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) {
return AccessResult::allowedIfHasPermission($account, 'create workspace');
return AccessResult::allowedIfHasPermissions($account, ['administer workspaces', 'create workspace'], 'OR');
}
}
......@@ -181,7 +181,7 @@ protected function getExpectedUnauthorizedAccessMessage($method) {
return "The 'view any workspace' permission is required.";
case 'POST':
return "The 'create workspace' permission is required.";
return "The following permissions are required: 'administer workspaces' OR 'create workspace'.";
case 'PATCH':
return "The 'edit any workspace' permission is required.";
......
......@@ -52,11 +52,15 @@ protected function setUp(): void {
*/
public function operationCases() {
return [
['create', 'administer workspaces'],
['create', 'create workspace'],
['view', 'administer workspaces'],
['view', 'view any workspace'],
['view', 'view own workspace'],
['update', 'administer workspaces'],
['update', 'edit any workspace'],
['update', 'edit own workspace'],
['delete', 'administer workspaces'],
['delete', 'delete any workspace'],
['delete', 'delete own workspace'],
];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment