Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
crm
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
crm
Commits
01bc0a34
Commit
01bc0a34
authored
3 months ago
by
Steven Ayers
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3508466
: Remove 'view own' permissions
parent
a2f480c7
No related branches found
No related tags found
1 merge request
!23
Issue #3508466 by bluegeek9: Remove 'view own' permissions
Pipeline
#458223
passed with warnings
2 months ago
Stage: build
Stage: validate
Stage: test
Changes
3
Pipelines
6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+3
-5
3 additions, 5 deletions
.gitlab-ci.yml
crm.permissions.yml
+0
-4
0 additions, 4 deletions
crm.permissions.yml
src/ContactAccessControlHandler.php
+2
-6
2 additions, 6 deletions
src/ContactAccessControlHandler.php
with
5 additions
and
15 deletions
.gitlab-ci.yml
+
3
−
5
View file @
01bc0a34
...
...
@@ -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
###################################################################################
#
...
...
This diff is collapsed.
Click to expand it.
crm.permissions.yml
+
0
−
4
View file @
01bc0a34
...
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
src/ContactAccessControlHandler.php
+
2
−
6
View file @
01bc0a34
...
...
@@ -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'
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment