AA_PERMISSION
Status: Entwurf · Quelle: Spec-Erweiterung RBAC/ACL · Spec-Kandidat: ja
Zweck
AA_PERMISSION deklariert eine zulässige Aktion (permission_action) auf einem Scope-Typ (acl_scope). AA_ROLE_PERMISSION weist diese Permission einer Rolle zu, optional konkretisiert auf ein einzelnes Scope-Objekt (DDM_ENTITY_TYPE, DDM_ENTITY oder DDM_RELATION_TYPE).
AA_PERMISSION
| Feld | Typ | Pflicht | Hinweise |
|---|---|---|---|
id | uuid | ja | PK |
key | text | ja | Format ^[a-z][a-z0-9_:.]*$, eindeutig (z. B. DDM_ENTITY.read, DDM_ENTITY_TYPE.manage) |
action | mdm.permission_action | ja | siehe Wertebereich |
scope | mdm.acl_scope | ja | bestimmt, gegen welches Scope-Feld in AA_ROLE_PERMISSION validiert wird |
description | text | nein | |
is_system | boolean | ja | default false. System-Permissions sind unveränderlich |
metadata | jsonb | ja | default '{}' |
| Audit-Felder | – | – |
UNIQUE-Constraint (action, scope).
Wertebereich permission_action
read, create, update, archive, restore, soft_delete, hard_delete, relate, unrelate, export, manage_metadata, manage_permissions, read_audit.
AA_ROLE_PERMISSION
| Feld | Typ | Pflicht | Hinweise |
|---|---|---|---|
id | uuid | ja | PK |
role_id | uuid | ja | FK → AA_ROLE |
permission_id | uuid | ja | FK → AA_PERMISSION |
effect | mdm.permission_effect | ja | default allow |
scope_entity_type_id | uuid | nein | Pflicht wenn AA_PERMISSION.scope='entity_type' |
scope_entity_id | uuid | nein | Pflicht wenn AA_PERMISSION.scope='entity' |
scope_relation_type_id | uuid | nein | Pflicht wenn AA_PERMISSION.scope='relation_type' |
metadata | jsonb | ja | default '{}' |
| Audit-/Soft-Delete-Felder | – | – |
Constraints und Trigger
role_permission_scope_exclusive_chk: höchstens ein Scope-Feld gesetzt.trg_role_permission_validate_scope: erzwingt Konsistenz zwischenAA_PERMISSION.scopeund gesetzten Scope-Feldern (siehe Trigger).uq_role_permission_active: Eindeutigkeit pro Rolle/Permission/Scope unter aktiven Einträgen.
Hinweise
effect=denyauf Rollenebene ist erlaubt und sinnvoll für „base role + deny ausnahme” Muster.- Service darf
is_system=true-Permissions nicht ändern.