Skip to content
Snippets Groups Projects
Commit fd842fd0 authored by Liam Morland's avatar Liam Morland Committed by Kevin Paxman
Browse files

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!70ISTWCMS-4631: Toolbar permissions instead of role checks
...@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment