Add the admin UI and docs for named access lists (fixes #125) #139
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
qwc-open/asiakirjat!139
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/access-list-admin-ui"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Last of the #125 series, on top of #136, #137 and #138. This is the step that makes named access lists reachable — and the first one that changes what you see in the app.
What an admin gets
Admin > Access Lists (new page, linked from the admin nav): create a list, add members, remove them, delete the list. A member is a user, an LDAP group, or an OAuth2 group with a viewer/editor role, so "the eng LDAP group plus two named contractors" is one ordinary list.
Project visibility picker gains Access list beside public/private/custom, on both the create form and the edit page, with a dropdown of the available lists. The option only appears once at least one list exists.
Behaviour worth noting
ON DELETE RESTRICTerror.listvisibility with no list selected is a 400, not a project that admits nobody.privatevisibility they can already choose.One drift fixed on the way
handleAdminUpdateProjecthad its own copy of the three-literal visibility check, and it silently coerced anything unrecognized tocustom. Both project handlers now callprojects.ValidateVisibility— the same functionService.Createuses — so an invalid value is reported rather than quietly rewriting the project's access model. That's a small behaviour change on a path the form can't normally reach.Tests
internal/handler/access_lists_test.godrives the real endpoints: creating a list, adding an LDAP group and a named user, rendering the page and finding both, removing a member, the refused delete (asserting the explanation reaches the redirect), giving a project list visibility and seeing the pointer stored, switching away and seeing it cleared, the missing-list 400, and that an editor can neither see the page nor create a list.The render assertions earned their place immediately — they caught the edit page comparing an
int64against an*int64, whichhtml/templaterejects at render time and a store-level test would never have seen.Docs
New
how-to/manage-access-lists.mdcovering the same ground, including why named users apply immediately while group members land at next sign-in.reference/roles-permissions.mdgains the fourth visibility and a permission-matrix row;manage-global-access.mdand the docs index point at the new page. Worth a Deploy Built-in Docs after merging.Deploying
Nothing changes for existing projects until someone creates a list and points a project at it. Once you do, the good first check is a list holding your own username as viewer — that path needs no login sync, so it should take effect immediately.
Assisted by Claude Opus 5.