diff --git a/src/Model/PermissionSet.php b/src/Model/PermissionSet.php index c9b2b17b67..90448806d8 100644 --- a/src/Model/PermissionSet.php +++ b/src/Model/PermissionSet.php @@ -89,11 +89,9 @@ class PermissionSet extends BaseObject $contact_str = '<' . $contact_id . '>'; - $condition = ["`uid` = ? AND (`allow_cid` = '' OR`allow_cid` REGEXP ?) - AND (`deny_cid` = '' OR NOT `deny_cid` REGEXP ?) - AND (`allow_gid` = '' OR `allow_gid` REGEXP ?) - AND (`deny_gid` = '' OR NOT `deny_gid` REGEXP ?)", - $uid, $contact_str, $contact_str, $group_str, $group_str]; + $condition = ["`uid` = ? AND (NOT (`deny_cid` REGEXP ? OR deny_gid REGEXP ?) + AND (allow_cid REGEXP ? OR allow_gid REGEXP ? OR (allow_cid = '' AND allow_gid = '')))", + $uid, $contact_str, $group_str, $contact_str, $group_str]; $ret = DBA::select('permissionset', ['id'], $condition); $set = [];