Fixed bug in privilege checking

This commit is contained in:
Marcin Kurczewski 2013-10-06 19:20:54 +02:00
parent 2ddc203fb8
commit 2cd7541042

View file

@ -17,9 +17,9 @@ class PrivilegesHelper
public static function confirm($user, $privilege) public static function confirm($user, $privilege)
{ {
$minAccessRank = isset(self::$privileges[$privilege]) $minAccessRank = isset(self::$privileges[$privilege])
? AccessRank::Admin ? self::$privileges[$privilege]
: self::$privileges[$privilege]; : AccessRank::Admin;
return $user->access_rank >= $minAccessRank; return intval($user->access_rank) >= $minAccessRank;
} }
public static function confirmWithException($user, $privilege) public static function confirmWithException($user, $privilege)