From fd842fd012bcaa1cdbbde77a1cec3645775ab501 Mon Sep 17 00:00:00 2001 From: Liam Morland <lkmorlan@uwaterloo.ca> Date: Thu, 11 Mar 2021 16:49:21 -0500 Subject: [PATCH] ISTWCMS-4631: Use permission 'access manage toolbar item' instead of role check --- uw_cfg_common.module | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 6c537891..2ae72038 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -183,17 +183,6 @@ function uw_cfg_common_toolbar_alter(&$items) { 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. if (!$current_user->hasPermission('access manage toolbar item')) { // Remove "Manage" toolbar item. -- GitLab