Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uw_cfg_common
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WCMS
uw_cfg_common
Commits
fd842fd0
Commit
fd842fd0
authored
4 years ago
by
Liam Morland
Committed by
Kevin Paxman
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ISTWCMS-4631: Use permission 'access manage toolbar item' instead of role check
parent
ae2c25ec
No related branches found
No related tags found
1 merge request
!70
ISTWCMS-4631: Toolbar permissions instead of role checks
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
uw_cfg_common.module
+0
-11
0 additions, 11 deletions
uw_cfg_common.module
with
0 additions
and
11 deletions
uw_cfg_common.module
+
0
−
11
View file @
fd842fd0
...
@@ -183,17 +183,6 @@ function uw_cfg_common_toolbar_alter(&$items) {
...
@@ -183,17 +183,6 @@ function uw_cfg_common_toolbar_alter(&$items) {
return
;
return
;
}
}
// Get the roles of the user.
$roles
=
$current_user
->
getRoles
();
// If there is only 1 role and that first role is authenticated, remove the
// manage link. If there are multiple roles then we know that they will have
// the Manage link, we are only removing the manage link for strictly
// authenticated users only.
if
(
count
(
$roles
)
==
1
&&
$roles
[
0
]
==
'authenticated'
)
{
// Remove the manage link.
unset
(
$items
[
'administration'
]);
}
// Adjust toolbar for non-admin users.
// Adjust toolbar for non-admin users.
if
(
!
$current_user
->
hasPermission
(
'access manage toolbar item'
))
{
if
(
!
$current_user
->
hasPermission
(
'access manage toolbar item'
))
{
// Remove "Manage" toolbar item.
// Remove "Manage" toolbar item.
...
...
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