Skip to content
Snippets Groups Projects
Commit 01bc0a34 authored by Steven Ayers's avatar Steven Ayers
Browse files

Issue #3508466: Remove 'view own' permissions

parent a2f480c7
No related branches found
No related tags found
1 merge request!23Issue #3508466 by bluegeek9: Remove 'view own' permissions
Pipeline #458223 passed with warnings
......@@ -47,14 +47,12 @@ include:
# Docs at https://git.drupalcode.org/project/gitlab_templates/-/blob/1.0.x/includes/include.drupalci.variables.yml
################
variables:
_PHPUNIT_EXTRA: --verbose
OPT_IN_TEST_PREVIOUS_MAJOR: 1
OPT_IN_TEST_PREVIOUS_MINOR: 1
OPT_IN_TEST_NEXT_MINOR: 1
OPT_IN_TEST_NEXT_MAJOR: 0
OPT_IN_TEST_MAX_PHP: 0
# _PHPUNIT_CONCURRENT=1 uses run-tests.sh, 0 uses phpunit directly.
_PHPUNIT_CONCURRENT: 1
OPT_IN_TEST_NEXT_MAJOR: 1
OPT_IN_TEST_MAX_PHP: 1
###################################################################################
#
......
......@@ -8,14 +8,10 @@ delete any crm_contact:
title: Delete <em>Any</em> Contact
delete own crm_contact:
title: Delete <em>Own</em> Contact
view own crm_contact label:
title: View <em>Own</em> Contact label
view any crm_contact label:
title: View <em>Any</em> Contact label
view any crm_contact:
title: View <em>Any</em> Contact
view own crm_contact:
title: View <em>Own</em> Contact
edit any crm_contact:
title: Edit <em>Any</em> Contact
edit own crm_contact:
......
......@@ -25,16 +25,12 @@ class ContactAccessControlHandler extends EntityAccessControlHandler {
switch ($operation) {
case 'view label':
$permissions = ['view any crm_contact label'];
if ($this->isOwner($entity, $account)) {
$permissions[] = 'view own crm_contact label';
}
return AccessResult::allowedIfHasPermissions($account, $permissions, 'OR');
case 'view':
$permissions = ['view any crm_contact'];
if ($this->isOwner($entity, $account)) {
$permissions[] = 'view own crm_contact';
}
return AccessResult::allowedIfHasPermissions($account, $permissions, 'OR');
case 'update':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment