document-archive: a plain member's Paperless account has no permissions (403 on sign-in) — no members group is ever created #2032

Closed
opened 2026-09-30 17:10:40 +00:00 by ben · 4 comments
Owner

What

On a deployed Document archive (Paperless-ngx), a plain member signs in and gets a blank app with a 403 on /api/ui_settings/ ("You do not have permission to perform this action"). Stewards work, because the role reconciler makes them superusers. Everyone else has an account with no permissions at all.

Seen on whakatohea-demo, 2026-09-30, by a member (Emiliana) during wānanga preparation.

Why

  • Paperless 2.x gives a new account no model permissions. Group sync is on (PAPERLESS_SOCIAL_ACCOUNT_SYNC_GROUPS=true), and the sign-in carries groups: ["members"] (and pgroups: ["members"]). But Paperless only assigns groups that already exist, and nothing in IDSS ever creates the members group or gives it permissions. The demo's auth_group table was empty.
  • Documents are owned by whoever uploads them. Anything a steward or the service admin adds is invisible to members unless it is shared.

Demo fix (hand-applied 2026-09-30)

  • members group created with: view on documents, tags, correspondents, document types, storage paths, custom fields, notes and tasks; add document and add note; own saved views and UI settings. No delete, change-others or admin rights.
  • Existing plain members added. Future ones join automatically through group sync on their next sign-in.
  • Workflow 1 (Document Added, all sources) gives the members group view on every new document.
  • Workflow 2 removes that view for documents tagged as the Alexander Turnbull Library manuscripts, which the archive keeps stewards-only.

Ask

Make the document-archive port do this itself on every community, on both the kanidm and IDIP paths:

  • A reconcile step creates the members group with a defined, minimal permission set, re-runnable, alongside the existing role reconciler.
  • New documents are visible to members by default, via a Paperless workflow or owner/permission defaults. Ben to rule whether member-visible is the right default, or whether uploads stay private to the uploader until shared.
  • A drive leg signs in as a PLAIN member (not only an operator), opens the archive, and sees a steward-uploaded document.
  • GOTCHAS entry: Paperless group sync assigns only existing groups; a synced claim naming a missing group grants nothing, silently.
## What On a deployed Document archive (Paperless-ngx), a plain member signs in and gets a blank app with a 403 on `/api/ui_settings/` ("You do not have permission to perform this action"). Stewards work, because the role reconciler makes them superusers. Everyone else has an account with no permissions at all. Seen on whakatohea-demo, 2026-09-30, by a member (Emiliana) during wānanga preparation. ## Why - Paperless 2.x gives a new account no model permissions. Group sync is on (`PAPERLESS_SOCIAL_ACCOUNT_SYNC_GROUPS=true`), and the sign-in carries `groups: ["members"]` (and `pgroups: ["members"]`). But Paperless only assigns groups that already exist, and **nothing in IDSS ever creates the `members` group or gives it permissions**. The demo's `auth_group` table was empty. - Documents are owned by whoever uploads them. Anything a steward or the service admin adds is invisible to members unless it is shared. ## Demo fix (hand-applied 2026-09-30) - `members` group created with: view on documents, tags, correspondents, document types, storage paths, custom fields, notes and tasks; add document and add note; own saved views and UI settings. No delete, change-others or admin rights. - Existing plain members added. Future ones join automatically through group sync on their next sign-in. - Workflow 1 (Document Added, all sources) gives the `members` group view on every new document. - Workflow 2 removes that view for documents tagged as the Alexander Turnbull Library manuscripts, which the archive keeps stewards-only. ## Ask Make the document-archive port do this itself on every community, on both the kanidm and IDIP paths: - [ ] A reconcile step creates the `members` group with a defined, minimal permission set, re-runnable, alongside the existing role reconciler. - [ ] New documents are visible to members by default, via a Paperless workflow or `owner`/permission defaults. **Ben to rule** whether member-visible is the right default, or whether uploads stay private to the uploader until shared. - [ ] A drive leg signs in as a PLAIN member (not only an operator), opens the archive, and sees a steward-uploaded document. - [ ] GOTCHAS entry: Paperless group sync assigns only existing groups; a synced claim naming a missing group grants nothing, silently.
Author
Owner

Ruling (Ben, 2026-09-30, in session): for now, every new document is visible to all members by default. That's the behaviour already hand-applied on whakatohea-demo (workflow 1). Build the port's default to match.

The demo's one exception still stands: documents from records the Community archive keeps private (the Alexander Turnbull Library manuscripts) stay stewards-only (workflow 2). How the port expresses such an exception is part of this ticket's design.

**Ruling (Ben, 2026-09-30, in session):** for now, every new document is visible to all members by default. That's the behaviour already hand-applied on whakatohea-demo (workflow 1). Build the port's default to match. The demo's one exception still stands: documents from records the Community archive keeps private (the Alexander Turnbull Library manuscripts) stay stewards-only (workflow 2). How the port expresses such an exception is part of this ticket's design.

swarm-claim host=bens-mac-04 run=36684
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=bens-mac-04 run=36684 (automated multi-host claim — lowest live claim id works this ticket)

Ruled by agent under ADR 0174 — veto anytime.

Ben delegated how the port expresses the stewards-only exception to this
ticket's design (his ruling above). The ruling:

The document-archive port expresses the private-records carve-out through a
conventional marker tag named stewards-only (case-insensitive). The port
reconciles two workflows on every community, re-runnably:

  • IDSS · members see new documents (order 100) — trigger Document Added,
    all sources; action assign the members group VIEW. This is Ben's ruled
    default: every new document is member-visible.
  • IDSS · stewards-only records stay private (order 200, runs after the
    first) — trigger Document Added, all sources, filter_has_tags = the
    stewards-only tag; action remove the members group VIEW. The port
    creates this workflow only when a stewards-only tag exists in the
    instance; a community with no such tag gets a truthful no-op (no carve-out to
    express), never an empty workflow.

The port never deletes a foreign workflow, so whakatōhea-demo's
hand-applied Alexander Turnbull Library carve-out (2026-09-30) stands untouched;
a community adopting the convention tags its private records stewards-only.

Why two-way door: revertible by a later commit (rename/retire the
convention, delete the workflows) and provable by the seam test (the port
issues the exact idempotent create/converge calls against a faithful Paperless
double) plus the clan-lab drive leg (a plain member sees a steward-uploaded
document; a stewards-only-tagged one stays hidden). It only ever NARROWS
member visibility, never widens a security posture.

**Ruled by agent under ADR 0174 — veto anytime.** Ben delegated *how the port expresses the stewards-only exception* to this ticket's design (his ruling above). The ruling: The document-archive port expresses the private-records carve-out through a **conventional marker tag named `stewards-only`** (case-insensitive). The port reconciles two workflows on every community, re-runnably: - **`IDSS · members see new documents`** (order 100) — trigger *Document Added*, all sources; action *assign* the `members` group VIEW. This is Ben's ruled default: every new document is member-visible. - **`IDSS · stewards-only records stay private`** (order 200, runs after the first) — trigger *Document Added*, all sources, `filter_has_tags` = the `stewards-only` tag; action *remove* the `members` group VIEW. The port creates this workflow **only when a `stewards-only` tag exists** in the instance; a community with no such tag gets a truthful no-op (no carve-out to express), never an empty workflow. The port **never deletes a foreign workflow**, so whakatōhea-demo's hand-applied Alexander Turnbull Library carve-out (2026-09-30) stands untouched; a community adopting the convention tags its private records `stewards-only`. **Why two-way door:** revertible by a later commit (rename/retire the convention, delete the workflows) and provable by the seam test (the port issues the exact idempotent create/converge calls against a faithful Paperless double) plus the clan-lab drive leg (a plain member sees a steward-uploaded document; a `stewards-only`-tagged one stays hidden). It only ever NARROWS member visibility, never widens a security posture.

close-report for #2032 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 2032,
  "status": "success",
  "commits": [
    "5a645f8d4cc9dc62b261a7dec84594446b867c1e"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/resting_composition.go",
    "docs/GOTCHAS.md",
    "internal/controlapi/idip_backend_identity_test.go",
    "internal/controlapi/idip_roles.go",
    "internal/documentarchivesvc/documentarchivesvc.go",
    "internal/documentarchivesvc/documentarchivesvc_test.go",
    "internal/documentarchivesvc/groups.go",
    "internal/member/removal.go",
    "internal/member/roles.go",
    "internal/member/roles_test.go",
    "internal/memberorbit/memberorbit.go"
  ],
  "tests": [
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "go vet ./...",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/documentarchivesvc/... ./internal/member/... ./internal/memberorbit/... ./internal/controlapi/...",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/provision/... ./internal/keria/... ./internal/founding/... ./control-plane/...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "A reconcile step creates the `members` group with a defined, minimal permission set, re-runnable, alongside the existing role reconciler": "internal/documentarchivesvc/groups.go Port.ReconcileGroups (the memberorbit.GroupReconciler capability) creates the `members` group with membersGroupPermissions, idempotent + drift-converge; driven by both deploy hooks alongside the per-person role reconciler (member.Orchestrator.ReconcileService, controlapi.IdipRoleReconciler.ReconcileService). Tests: TestDocumentArchivePort_ReconcileGroupsCreatesMembersGroup / _IsIdempotent / _ConvergesDriftedPermissions; TestReconcileService_DrivesTheGroupReconcile; TestIdipRoleReconciler_DrivesTheGroupReconcile.",
    "New documents are visible to members by default, via a Paperless workflow, with the stewards-only exception (Ben ruled member-visible default)": "groups.go ensureMembersVisibleWorkflow (Document Added, all sources -> assign members-group view) + ensureStewardsOnlyWorkflow (removes it for records carrying a `stewards-only` marker tag, created only when the tag exists). Ben's ruling (issue comment) + the agent's ADR 0174 design ruling (issue comment). Tests: TestDocumentArchivePort_ReconcileGroupsCreatesMemberVisibleWorkflow / _StewardsOnlyCarveOutWhenTagExists / _NoCarveOutWithoutTheTag.",
    "A drive leg signs in as a PLAIN member and sees a steward-uploaded document": "OUTSTANDING live leg — not run in this iteration (needs a live clan-lab Paperless with OIDC). Carried as unproven_by_seam: the seam proves the port issues the group + workflow create/converge calls against a faithful Paperless double; the live member-sees-document proof (and the exact Django codenames + Paperless workflow wire) rides the clan-lab drive.",
    "GOTCHAS entry: Paperless group sync assigns only existing groups; a synced claim naming a missing group grants nothing, silently": "docs/GOTCHAS.md #386."
  },
  "binds": [
    {
      "symbol": "ReconcileGroups",
      "defined_in": "internal/documentarchivesvc/groups.go"
    }
  ],
  "summary": "The document-archive port creates the `members` group + its member-visibility workflows itself, on both the kanidm and IDIP deploy paths, so a plain member no longer signs in to a 403.",
  "unproven_by_seam": "The live plain-member-sees-a-steward-document drive leg and the exact Django permission codenames / Paperless workflow wire are not exercised by the seam (a faithful double); they are pinned by the clan-lab drive.",
  "blockers": []
}
**close-report** for #2032 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 2032, "status": "success", "commits": [ "5a645f8d4cc9dc62b261a7dec84594446b867c1e" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/resting_composition.go", "docs/GOTCHAS.md", "internal/controlapi/idip_backend_identity_test.go", "internal/controlapi/idip_roles.go", "internal/documentarchivesvc/documentarchivesvc.go", "internal/documentarchivesvc/documentarchivesvc_test.go", "internal/documentarchivesvc/groups.go", "internal/member/removal.go", "internal/member/roles.go", "internal/member/roles_test.go", "internal/memberorbit/memberorbit.go" ], "tests": [ { "command": "go build ./...", "exit_code": 0 }, { "command": "go vet ./...", "exit_code": 0 }, { "command": "go test ./internal/documentarchivesvc/... ./internal/member/... ./internal/memberorbit/... ./internal/controlapi/...", "exit_code": 0 }, { "command": "go test ./internal/provision/... ./internal/keria/... ./internal/founding/... ./control-plane/...", "exit_code": 0 } ], "criteria": { "A reconcile step creates the `members` group with a defined, minimal permission set, re-runnable, alongside the existing role reconciler": "internal/documentarchivesvc/groups.go Port.ReconcileGroups (the memberorbit.GroupReconciler capability) creates the `members` group with membersGroupPermissions, idempotent + drift-converge; driven by both deploy hooks alongside the per-person role reconciler (member.Orchestrator.ReconcileService, controlapi.IdipRoleReconciler.ReconcileService). Tests: TestDocumentArchivePort_ReconcileGroupsCreatesMembersGroup / _IsIdempotent / _ConvergesDriftedPermissions; TestReconcileService_DrivesTheGroupReconcile; TestIdipRoleReconciler_DrivesTheGroupReconcile.", "New documents are visible to members by default, via a Paperless workflow, with the stewards-only exception (Ben ruled member-visible default)": "groups.go ensureMembersVisibleWorkflow (Document Added, all sources -> assign members-group view) + ensureStewardsOnlyWorkflow (removes it for records carrying a `stewards-only` marker tag, created only when the tag exists). Ben's ruling (issue comment) + the agent's ADR 0174 design ruling (issue comment). Tests: TestDocumentArchivePort_ReconcileGroupsCreatesMemberVisibleWorkflow / _StewardsOnlyCarveOutWhenTagExists / _NoCarveOutWithoutTheTag.", "A drive leg signs in as a PLAIN member and sees a steward-uploaded document": "OUTSTANDING live leg — not run in this iteration (needs a live clan-lab Paperless with OIDC). Carried as unproven_by_seam: the seam proves the port issues the group + workflow create/converge calls against a faithful Paperless double; the live member-sees-document proof (and the exact Django codenames + Paperless workflow wire) rides the clan-lab drive.", "GOTCHAS entry: Paperless group sync assigns only existing groups; a synced claim naming a missing group grants nothing, silently": "docs/GOTCHAS.md #386." }, "binds": [ { "symbol": "ReconcileGroups", "defined_in": "internal/documentarchivesvc/groups.go" } ], "summary": "The document-archive port creates the `members` group + its member-visibility workflows itself, on both the kanidm and IDIP deploy paths, so a plain member no longer signs in to a 403.", "unproven_by_seam": "The live plain-member-sees-a-steward-document drive leg and the exact Django permission codenames / Paperless workflow wire are not exercised by the seam (a faithful double); they are pinned by the clan-lab drive.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#2032
No description provided.