| REQ-SEP-001 |
The system shall manage mandators and scopes; every scope shall have a type (GLOBAL, MANDATOR, PROJECT), capability flags, and — except the global scope — a mandator. |
STR-003, STR-006; ADR-0002 |
| REQ-SEP-002 |
Every scope shall have a short, unique, immutable scope code. |
STR-001; §8.1 |
| REQ-SEP-003 |
Every content-bearing database row shall carry its scope key. |
STR-003; ADR-0002 |
| REQ-SEP-004 |
PostgreSQL Row-Level Security policies shall deny any access to rows of scopes the requesting user is not authorized for, independent of application code. |
STR-003; ADR-0002 |
| REQ-SEP-005 |
A user shall access a scope's content only with a role assignment granting a read permission effective in that scope (its own or an ancestor scope, per the cascade in REQ-ADM-003); released global-base content is readable per REQ-SEP-010. (refined) |
STR-003, STR-004; ADR-0002, ADR-0012 |
| REQ-SEP-006 |
Behavioral differences between scope types shall be implemented exclusively via capability flags, not type-conditional code branches. |
STR-005; ADR-0002 |
| REQ-SEP-007 |
An automated separation test suite shall prove at the database level that cross-scope access is impossible, and shall run in CI on every change. |
STR-003, STR-014; ADR-0002, RISK-001 |
| REQ-SEP-008 |
A mandator shall be classifiable as internal (the operating organization) or external (a customer). The classification is a reporting/filtering attribute only and shall not alter process behaviour. |
STR-015; ADR-0010, ADR-0002 |
| REQ-SEP-009 |
The operating organization's QMS operations shall be held in one or more PROJECT scopes under an internal mandator, subject to the same separation, life-cycle, catalog, and derivation rules as any project scope. |
STR-015; ADR-0010 |
| REQ-SEP-010 |
Released global-base content shall be readable by users holding a base-read permission via a global-scope role assignment, and implicitly during a DERIVE operation performed by a user authorized to derive in the target scope; it shall not be readable by users without such authorization. |
STR-003, STR-004; ADR-0002, ADR-0012 |
| REQ-SEP-011 |
The RLS scope context (lqms.authorized_scope_ids) shall be request-bounded — set transaction-scoped (SET LOCAL) or reset when a connection returns to the pool — so a pooled connection cannot carry a prior request's authorized scopes; the separation test suite (REQ-SEP-007) shall include a pooled-connection-reuse case. |
STR-003; ADR-0026, ADR-0009 |
| REQ-SEP-012 |
RLS shall guard content-bearing tables (documents, versions, content parts, audit events, search index, and any table holding mandator/project data), keyed to the authorized scope set. Structural control-plane tables (scope, mandator, catalogs, identity, authorization tables) shall not be under per-request content RLS; their access shall be governed by the permission model. |
STR-003; ADR-0027, ADR-0002 |