Honour workspaces in API authorization #322

Closed
opened 2026-10-27 13:35:51 +00:00 by sam · 0 comments
Owner

Goal

The API passes the record's workspace (and owner/state where the policy needs it) to the access engine, so workspace policies and per-workspace roles take effect.

Evidence

internal/webui/authorize.go:36 builds access.Resource{Kind,ID,Org} with no Workspace. internal/infrastructure/access/engine.go:250 adds the workspace level only when set.

Rules

Read CLAUDE.md. Do only what the Goal and Stop when need. File anything else you notice as a bead; do not fix it. Run task check once at the end; if it fails twice on the same problem, comment on this bead and stop.

Stop when

  • Requests for a record carry its workspace into Authorize.
  • A workspace forbid policy denies the action on that workspace's records through the API (one table-driven test in the access seam).
  • A workspace-scoped role overrides the org role.
    Then commit (Conventional Commits, scoped by package), bd close this bead and stop.

Close reason

Fixed on feat/org-epic (PR #1634)


Imported from beads archie-core-kgxw.9 · GitHub #1322 · type feature · priority P2 · created 2026-10-05 · closed 2026-10-11

## Goal The API passes the record's workspace (and owner/state where the policy needs it) to the access engine, so workspace policies and per-workspace roles take effect. ## Evidence internal/webui/authorize.go:36 builds access.Resource{Kind,ID,Org} with no Workspace. internal/infrastructure/access/engine.go:250 adds the workspace level only when set. ## Rules Read CLAUDE.md. Do only what the Goal and Stop when need. File anything else you notice as a bead; do not fix it. Run `task check` once at the end; if it fails twice on the same problem, comment on this bead and stop. ## Stop when - [ ] Requests for a record carry its workspace into Authorize. - [ ] A workspace forbid policy denies the action on that workspace's records through the API (one table-driven test in the access seam). - [ ] A workspace-scoped role overrides the org role. Then commit (Conventional Commits, scoped by package), `bd close` this bead and stop. ### Close reason Fixed on feat/org-epic (PR #1634) --- _Imported from beads `archie-core-kgxw.9` · GitHub #1322 · type feature · priority P2 · created 2026-10-05 · closed 2026-10-11_
sam added the mediumfeature labels 2026-10-27 13:35:51 +00:00
sam self-assigned this 2026-10-27 13:35:51 +00:00
sam closed this issue 2026-10-27 13:35:51 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#322