feat(roles): company rule for separate determination and approval #129

Merged
sharang merged 1 commits from feat/company-rules into main 2026-11-12 17:17:58 +00:00
Owner

docgen#4 Nr. 31 (Benjamin, as corrected; AK-R3-030): four eyes on the R3 approval apply only when the customer switches on the company rule "Festlegung und Freigabe durch verschiedene Personen" in the role dataset.

  • roles.Dataset.CompanyRules (company_rules, optional) holds separate_approval.
    • Not set counts as off.
    • Stamped from the writer's token; unchanged values keep their stamps.
    • Historised with the dataset revisions.
    • Maintained by whoever may maintain the dataset (AM-3, unchanged MayWrite).
  • GET /v1/tenants/{id}/role-dataset/rules returns {revision, catalogue_version, separate_approval, recorded_at}. It is for Werkmeister (tenants.read) or a member, the same guard as /holders.
  • No migration (a field of the JSON document), no catalogue version bump. Older datasets decode unchanged and store no section.
  • Tests: TestPrepare_companyRules, TestRoleDataset_rules, path list.

Prod: additive and off by default. If this merges before control-center's next registry promotion (#128), it goes to prod with that promotion, which control-center confirmed is fine. Nothing reads it on prod until Werkmeister's check is promoted.

Control-center was told beforehand (no collision).

🤖 Generated with Claude Code

https://claude.ai/code/session_014aRnCGqELxoix5TfpX8Ejf

docgen#4 Nr. 31 (Benjamin, as corrected; AK-R3-030): four eyes on the R3 approval apply only when the customer switches on the company rule "Festlegung und Freigabe durch verschiedene Personen" in the role dataset. - `roles.Dataset.CompanyRules` (`company_rules`, optional) holds `separate_approval`. - Not set counts as off. - Stamped from the writer's token; unchanged values keep their stamps. - Historised with the dataset revisions. - Maintained by whoever may maintain the dataset (AM-3, unchanged `MayWrite`). - `GET /v1/tenants/{id}/role-dataset/rules` returns `{revision, catalogue_version, separate_approval, recorded_at}`. It is for Werkmeister (`tenants.read`) or a member, the same guard as `/holders`. - No migration (a field of the JSON document), no catalogue version bump. Older datasets decode unchanged and store no section. - Tests: `TestPrepare_companyRules`, `TestRoleDataset_rules`, path list. **Prod:** additive and off by default. If this merges before control-center's next registry promotion (#128), it goes to prod with that promotion, which control-center confirmed is fine. Nothing reads it on prod until Werkmeister's check is promoted. Control-center was told beforehand (no collision). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014aRnCGqELxoix5TfpX8Ejf
sharang added 1 commit 2026-11-12 17:11:30 +00:00
feat(roles): company rule for separate determination and approval
ci / shared (pull_request) Successful in 11s
ci / test (pull_request) Successful in 5m51s
ci / image (pull_request) Skipped
0f7cc29f10
docgen#4 Nr. 31 (AK-R3-030): the role dataset gets an optional section
company_rules with separate_approval ("Festlegung und Freigabe durch
verschiedene Personen"). Not set counts as off.

- The rule is maintained by whoever maintains the dataset (AM-3),
  stamped from the writer's token, and historised with the revisions.
- Older datasets decode unchanged and store no section.
- GET /v1/tenants/{id}/role-dataset/rules answers the rules now for
  Werkmeister (tenants.read) or a member of the tenant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014aRnCGqELxoix5TfpX8Ejf
sharang merged commit 9cf4f7db05 into main 2026-11-12 17:17:58 +00:00
Sign in to join this conversation.