The company's role and authority dataset (Rollen- und Befugnisdatensatz) for R1 S0 (docgen#1: plan 13781 §3.2 no. 2, owner addendum 13791; S0 is released there). Stage only.
Replaces #92 (one clean commit; the catalogue's Go field is Code, so gitleaks' generic-api-key rule no longer matches; the JSON field stays key).
Design: research/r1-phase-b/s0-registry-change.md (reviewed and approved by Sharang, Q6).
What
internal/roles: the catalogue in code (r1-2026-10-26.1).
21 functions: the union of A1 §2.3 (18) and A4 §4 (the seven of R1-D02 §18), with similar names kept apart (B14).
14 customer decision types. Only the three releases carry an owner default (management); the others have to be set by the company and resolve to rolle_offen until then.
Rules (each with a test that fails when the rule is taken out; mutation-checked):
B7: a deputy is wirksam only with a documented basis, within its validity and, where it covers management authority, with management's authorization. What management records itself, it has authorized.
Stamps:recorded_* and authorized_* come from the token, never from the body. A changed deputyship loses its authorization, and nobody authorizes their own.
Who writes: management and document owners. While no management holder exists, the OWNER sign-in role may record management and nothing else.
B8: another release body for R1-D02 updates only with the provision of R1-D02 that names it.
Validation: unknown keys and unknown catalogue keys are refused, as are wrong scopes and holder kinds.
Routes:GET/PUT /v1/tenants/{id}/role-dataset, GET …/revisions/{rev}, GET …/resolve?decision_type=….
Writes need the user's token (user_token_required otherwise), and X-Portal-User-* is ignored.
User tokens on these routes form route group role-dataset.user, so the portal's sign-in client gets no tenants grant.
Werkmeister reads with its existing tenants.read.
Migration 0024:role_datasets and role_dataset_revisions, versioned like the company profile (expected_revision, 409). The migration test lists are updated.
Audit:role_dataset.saved records the revision and the changed entry ids only (no names, contacts or texts).
CI: the test step now also runs ./internal/roles/....
Not in this PR
Stage config, in a separate orca-platform PR: tenant-registry-audience on portal-stage, and portal-stage:role-dataset.user in AUTHZ_RULES. Until then the portal gets 401/403 here, so this PR is safe to deploy first.
Portal UI ("Wer darf was"), Werkmeister G1 (needs the owner's approval of the work package), production.
migrations/ tests are not in the CI test step (unchanged).
The company's role and authority dataset (Rollen- und Befugnisdatensatz) for R1 S0 (docgen#1: plan 13781 §3.2 no. 2, owner addendum 13791; S0 is released there). Stage only.
Replaces #92 (one clean commit; the catalogue's Go field is `Code`, so gitleaks' generic-api-key rule no longer matches; the JSON field stays `key`).
Design: `research/r1-phase-b/s0-registry-change.md` (reviewed and approved by Sharang, Q6).
### What
- **`internal/roles`**: the catalogue in code (`r1-2026-10-26.1`).
- 21 functions: the union of A1 §2.3 (18) and A4 §4 (the seven of R1-D02 §18), with similar names kept apart (B14).
- 14 customer decision types. Only the three releases carry an owner default (management); the others have to be set by the company and resolve to `rolle_offen` until then.
- **Rules** (each with a test that fails when the rule is taken out; mutation-checked):
- **B7:** a deputy is `wirksam` only with a documented basis, within its validity and, where it covers management authority, with management's authorization. What management records itself, it has authorized.
- **Stamps:** `recorded_*` and `authorized_*` come from the token, never from the body. A changed deputyship loses its authorization, and nobody authorizes their own.
- **Who writes:** management and document owners. While no management holder exists, the OWNER sign-in role may record management and nothing else.
- **B8:** another release body for R1-D02 updates only with the provision of R1-D02 that names it.
- **Validation:** unknown keys and unknown catalogue keys are refused, as are wrong scopes and holder kinds.
- **Routes:** `GET/PUT /v1/tenants/{id}/role-dataset`, `GET …/revisions/{rev}`, `GET …/resolve?decision_type=…`.
- Writes need the **user's token** (`user_token_required` otherwise), and `X-Portal-User-*` is ignored.
- User tokens on these routes form route group `role-dataset.user`, so the portal's sign-in client gets no `tenants` grant.
- Werkmeister reads with its existing `tenants.read`.
- **Migration 0024:** `role_datasets` and `role_dataset_revisions`, versioned like the company profile (`expected_revision`, 409). The migration test lists are updated.
- **Audit:** `role_dataset.saved` records the revision and the changed entry ids only (no names, contacts or texts).
- **CI:** the `test` step now also runs `./internal/roles/...`.
### Not in this PR
- Stage config, in a separate orca-platform PR: `tenant-registry-audience` on `portal-stage`, and `portal-stage:role-dataset.user` in `AUTHZ_RULES`. Until then the portal gets 401/403 here, so this PR is safe to deploy first.
- Portal UI ("Wer darf was"), Werkmeister G1 (needs the owner's approval of the work package), production.
- `migrations/` tests are not in the CI test step (unchanged).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_014aRnCGqELxoix5TfpX8Ejf
One Rollen- und Befugnisdatensatz per company (docgen#1 plan 13781 §3.2
no. 2, owner addendum 13791): functions, who holds them, deputies with
their basis, the deciding function per decision type, immediate
authority, standard releases, named editors and the contact path for
critical security events.
- internal/roles: the catalogue in code (version r1-2026-10-26.1), the
union of A1 §2.3 and A4 §4 = 21 functions, 14 customer decision types;
only the three releases carry an owner default (management), the rest
must be set by the company.
- Rules: a deputy is wirksam only with a documented basis, within its
validity and, where it covers management authority, with management's
authorization (B7 wording: what management records it has authorized);
another release body for R1-D02 updates only with the R1-D02 provision
(B8); management and document owners write, the OWNER sign-in role may
only record the first management holder; recorded_*/authorized_* are
stamped from the token, never from the body; no self-authorization.
- Routes: GET/PUT /v1/tenants/{id}/role-dataset, GET …/revisions/{rev},
GET …/resolve. Writes need the user's token; user tokens on these
routes form route group role-dataset.user, so the portal's sign-in
client needs no tenants grant.
- Migration 0024: role_datasets and role_dataset_revisions, versioned as
the company profile (expected_revision, 409 on conflict).
- Audit role_dataset.saved with revision and changed entry ids only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014aRnCGqELxoix5TfpX8Ejf
sharang
merged commit 1b9e2f1183 into main2026-10-26 21:18:58 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The company's role and authority dataset (Rollen- und Befugnisdatensatz) for R1 S0 (docgen#1: plan 13781 §3.2 no. 2, owner addendum 13791; S0 is released there). Stage only.
Replaces #92 (one clean commit; the catalogue's Go field is
Code, so gitleaks' generic-api-key rule no longer matches; the JSON field stayskey).Design:
research/r1-phase-b/s0-registry-change.md(reviewed and approved by Sharang, Q6).What
internal/roles: the catalogue in code (r1-2026-10-26.1).rolle_offenuntil then.wirksamonly with a documented basis, within its validity and, where it covers management authority, with management's authorization. What management records itself, it has authorized.recorded_*andauthorized_*come from the token, never from the body. A changed deputyship loses its authorization, and nobody authorizes their own.GET/PUT /v1/tenants/{id}/role-dataset,GET …/revisions/{rev},GET …/resolve?decision_type=….user_token_requiredotherwise), andX-Portal-User-*is ignored.role-dataset.user, so the portal's sign-in client gets notenantsgrant.tenants.read.role_datasetsandrole_dataset_revisions, versioned like the company profile (expected_revision, 409). The migration test lists are updated.role_dataset.savedrecords the revision and the changed entry ids only (no names, contacts or texts).teststep now also runs./internal/roles/....Not in this PR
tenant-registry-audienceonportal-stage, andportal-stage:role-dataset.userinAUTHZ_RULES. Until then the portal gets 401/403 here, so this PR is safe to deploy first.migrations/tests are not in the CI test step (unchanged).🤖 Generated with Claude Code
https://claude.ai/code/session_014aRnCGqELxoix5TfpX8Ejf
One Rollen- und Befugnisdatensatz per company (docgen#1 plan 13781 §3.2 no. 2, owner addendum 13791): functions, who holds them, deputies with their basis, the deciding function per decision type, immediate authority, standard releases, named editors and the contact path for critical security events. - internal/roles: the catalogue in code (version r1-2026-10-26.1), the union of A1 §2.3 and A4 §4 = 21 functions, 14 customer decision types; only the three releases carry an owner default (management), the rest must be set by the company. - Rules: a deputy is wirksam only with a documented basis, within its validity and, where it covers management authority, with management's authorization (B7 wording: what management records it has authorized); another release body for R1-D02 updates only with the R1-D02 provision (B8); management and document owners write, the OWNER sign-in role may only record the first management holder; recorded_*/authorized_* are stamped from the token, never from the body; no self-authorization. - Routes: GET/PUT /v1/tenants/{id}/role-dataset, GET …/revisions/{rev}, GET …/resolve. Writes need the user's token; user tokens on these routes form route group role-dataset.user, so the portal's sign-in client needs no tenants grant. - Migration 0024: role_datasets and role_dataset_revisions, versioned as the company profile (expected_revision, 409 on conflict). - Audit role_dataset.saved with revision and changed entry ids only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aRnCGqELxoix5TfpX8Ejf