From 54bc9a7553fc44d8624f1e6d293fe186bf4734dd Mon Sep 17 00:00:00 2001 From: MrPMan Date: Sun, 3 Jan 2016 23:59:02 -0800 Subject: [PATCH] Removed unnecessary permissions code $UserInfo['Level'] will never be higher than $UserInfo['EffectiveClass'], as that's the whole point of EffectiveClass. As such, it is pointless to run a comparison against both Level and EffectiveClass in check_perms, as $UserInfo['EffectiveClass'] >= $UserInfo['Level'], so if $UserInfo['Level'] >= $MinClass, $UserInfo['EffectiveClass'] >= $MinClass. --- classes/permissions.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/classes/permissions.class.php b/classes/permissions.class.php index 4af3060e..ae57dbb5 100644 --- a/classes/permissions.class.php +++ b/classes/permissions.class.php @@ -14,8 +14,7 @@ public static function check_perms($PermissionName, $MinClass = 0) { return ( isset(G::$LoggedUser['Permissions'][$PermissionName]) && G::$LoggedUser['Permissions'][$PermissionName] - && (G::$LoggedUser['Class'] >= $MinClass - || G::$LoggedUser['EffectiveClass'] >= $MinClass + && (G::$LoggedUser['EffectiveClass'] >= $MinClass || $Override) ) ? true : false; }