diff options
author | Udo Walter | 2017-11-21 18:16:26 +0100 |
---|---|---|
committer | Udo Walter | 2017-11-21 18:16:26 +0100 |
commit | 3e8e5801fa88768bf0957f64b911d822ac28fead (patch) | |
tree | 707ebbd89cfbd74babd2939beea58b715ce070de /modules-available/permissionmanager/inc/permissionutil.inc.php | |
parent | Merge remote-tracking branch 'origin/master' into permission-manager (diff) | |
download | slx-admin-3e8e5801fa88768bf0957f64b911d822ac28fead.tar.gz slx-admin-3e8e5801fa88768bf0957f64b911d822ac28fead.tar.xz slx-admin-3e8e5801fa88768bf0957f64b911d822ac28fead.zip |
[permissionmanager] fixed bug: role without locations was shown as role with all locations;
Diffstat (limited to 'modules-available/permissionmanager/inc/permissionutil.inc.php')
-rw-r--r-- | modules-available/permissionmanager/inc/permissionutil.inc.php | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/modules-available/permissionmanager/inc/permissionutil.inc.php b/modules-available/permissionmanager/inc/permissionutil.inc.php index 17257eec..391cd047 100644 --- a/modules-available/permissionmanager/inc/permissionutil.inc.php +++ b/modules-available/permissionmanager/inc/permissionutil.inc.php @@ -29,11 +29,9 @@ class PermissionUtil public static function getAllowedLocations($userid, $permissionid) { - $res = Database::simpleQuery("SELECT role_x_permission.permissionid, rxl.locationid - FROM user_x_role + $res = Database::simpleQuery("SELECT permissionid, COALESCE(locationid, 0) AS locationid FROM user_x_role INNER JOIN role_x_permission ON user_x_role.roleid = role_x_permission.roleid - LEFT JOIN (SELECT roleid, COALESCE(locationid, 0) AS locationid FROM role_x_location) rxl - ON role_x_permission.roleid = rxl.roleid + INNER JOIN role_x_location ON role_x_permission.roleid = role_x_location.roleid WHERE user_x_role.userid = :userid", array("userid" => $userid)); $allowedLocations = array(); |