mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-08-31 08:57:14 +02:00
The LDAP sync only ever granted the base "user" role. Add an optional auth.ldap.role-filters map (role -> LDAP filter) so accounts matching a filter are granted that elevated role (admin/support/api/manager). LDAP is authoritative for the configured roles: sync both adds and removes them to match group membership, while roles not listed (e.g. a manually granted manager) are preserved. A managed manager that still has assigned projects is never stripped. With no role-filters configured behaviour is identical to before. Roles are reconciled during periodic sync and at login. Sync evaluates each filter once over the whole base (one search per role, not per user) and reconciles existing users via a single ListUsers lookup plus the new UserRepository.UpdateRoles helper. Closes #74 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Entire-Checkpoint: e38526c3259d