Commit 7df39b5d authored by catch's avatar catch

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
......@@ -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'],
];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment