Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Drupal Upstream
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
ASC IRIS Web Services
Drupal Upstream
Commits
5dafc7fb
Commit
5dafc7fb
authored
1 year ago
by
Michael Lee
Browse files
Options
Downloads
Plain Diff
Merge branch 'userprotect' into lee5151
parents
b6fd2c78
26ae3f89
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
web/modules/userprotect/userprotect.module
+6
-0
6 additions, 0 deletions
web/modules/userprotect/userprotect.module
with
6 additions
and
0 deletions
web/modules/userprotect/userprotect.module
+
6
−
0
View file @
5dafc7fb
...
...
@@ -29,6 +29,12 @@ function userprotect_rule_load($name) {
* Implements hook_ENTITY_TYPE_access() for entity type "user".
*/
function
userprotect_user_access
(
UserInterface
$entity
,
$op
,
AccountInterface
$account
)
{
// User Protect doesn't limit view access in any way, so bail out early to
// save time.
if
(
in_array
(
$op
,
[
'view'
,
'view label'
]))
{
return
AccessResult
::
neutral
();
}
// Check if the account has the permission "userprotect.bypass_all".
// If so, all protections rules should be ignored.
if
(
!
$account
->
hasPermission
(
'userprotect.bypass_all'
))
{
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
Next
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