Roles: per-board admins, and a super-admin from the config #192
Labels
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Grandiras/Ponente#192
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Part of #190, which has the role table this implements. Read
docs/boards-and-permissions.mdanddocs/auth.mdfirst — this issue deliberately reverses "a board is not owned" and "admins see every board", and both pages have to say the new thing, with the new reason, in the same pull request.No new screens. After this, the app looks the same to everyone and the rights underneath have moved.
The model
BoardMembergets a role — member or admin. A role on the grant row rather than anOwnerDidonBoard: several admins are possible, handing a board over is one row, and it is the shape a Spaces member list will have.BoardViewer(Did, IsAdmin)is built once per circuit from the allowlist today; thatIsAdminhas to come from the board being resolved instead.BoardAccess.VisibleToloses its admin bypass, and the two admin branches inCardPermissionsread the board role. Keep the property that a call site cannot forget who is asking.CardPermissions.BoardService,ColumnServiceandTagServicemutators take the viewer and go through it; today they take none because only a page behind theAdminpolicy can reach them, and that stops being true in the next step.Allowlist:Admins[], read at runtime. TodayDatabaseInitializeronly seeds those DIDs on first run andMembers.Roleis the truth afterwards. TheAdminpolicy becomes the super-admin policy and gates the invite list:/admin/members, the requests panel, the invites panel. A super-admin is always allowlisted.deploy/README.mdshould say that removing a DID from the env now demotes on restart.DuplicateBoardNameExceptionwould tell a member that a private board called "Redundancies" exists.Migrating
The rule from #190: nobody's access changes on deploy day, and the previous release can still run against this database.
Membersrow with the admin role becomes a board admin on every existing board. None of those columns is encrypted, so this is SQL inside the migration, not a startup pass. If a deployment somehow has no admin row, the configured super-admin DIDs take their place, so no board is left without one.BoardMemberrows default to member.Visibilityis untouched: anEveryoneboard stays everyone's.Members.Rolestays in the schema for this release, unread, and is dropped in a later one. Dropping it now means a rollback starts a build that selects a column that is gone.Tests
access.spec.jsandpermissions.spec.jscarry most of it: a board admin who is not the super-admin can do on their board what an admin could; a super-admin not on a restricted board cannot open it, and it is not in their switcher; the last admin cannot be removed.BoardAccessTestsfor the expression, plus a unit test for the new permissions class. The migration's backfill deserves a test of its own if the suite can reach it.🤖 On it — the reply will link the full session transcript.
Steps 1–2 verified (the step-3 "failure" was my script checking an already-on toggle — correctly not dirty). Let me check whether the full e2e stack is runnable here:
The run reported an error after replying: This operation was aborted
→ Opened PR: #201
⏱ 45m 2s · 215 steps · $1.5586 · tokens: 1742.4k in / 92.3k out (+41702.9k cache-read) · Go: 5h 41% · wk 41% · mo 22%
📜 Full session transcript