mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 20:45:00 -05:00
#6540 - with `ldap-sync-admin-groups` set to ONE group, every user that logged in became a WeKan administrator. Two independent causes. The group query builds `(&(objectclass=group)(member=<the user>))`. The member clause - the one that says WHOSE groups these are - was left OUT whenever the user entry had no value for the configured member format, and the search then ran as `(&(objectclass=group))`, which answers with EVERY group in the directory. So every user "was in" the admin group. (A login restricted by group let everyone in for the same reason.) It now answers with NO groups in that case, names the misconfigured setting in the log, and first tries the usual other spellings of the same value (dn / objectName / distinguishedName). The clause is added after the guard, so it cannot be skipped silently again. The comparison was `LDAP_SYNC_ADMIN_GROUPS.split(',')` matched exactly: "ti, admins" produced " admins" and matched nothing, an unset value produced [''] - one empty string - which matched a group whose name the directory did not return, and Active Directory's case-insensitive names did not match at all. It is one shared rule now (packages/wekan-ldap/server/adminGroups.js): trimmed, case-insensitive, multi-valued names flattened, and an EMPTY configured list can never grant admin. Login and background sync use it, so they cannot drift. #6537 - "Search All Boards" answered "Server Error", with `$nin needs an array` in the log. Two calls in the global-search publication were not awaited, so a PROMISE was handed to Mongo where an array belongs. The `$nin` pair had been fixed; the `$in` pair on the archived/all branch had not. And both id helpers were declared with no parameter while their callers passed a userId, so they asked for the boards of `undefined`: the archived half of a search matched nothing even when it ran. #6544 - the REST route to create a checklist item exists (it did not when that was reported), but every item it created was given `sort: 0`, so a checklist filled over the API came out in an order nobody chose. It appends now, like the UI, and an explicit `sort` in the body still wins. Thanks to karvox, ahlgrimma, frantzstaboeeg and xet7 ! Fixes #6540, Fixes #6537, Fixes #6544.