Merge branch 'feature/rbac-04-modul-scoped-berechtigungen' into feature/qa-03-pruefgate-rechte-policy

This commit is contained in:
sysops
2026-08-29 00:10:21 +02:00
8 changed files with 457 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
DROP TABLE IF EXISTS feature_flags;
+10
View File
@@ -0,0 +1,10 @@
-- Feature-Flags zentral je Mandant/Zielgruppe (LIC-02, siehe core-kanban/tickets/LIC-02.md).
-- Lebt in der Registry-DB, nicht pro Tenant-Datenbank — Flags sind eine
-- Core-weite Konfiguration, keine Mandanten-Geschaeftsdaten.
CREATE TABLE feature_flags (
key TEXT PRIMARY KEY,
enabled BOOLEAN NOT NULL DEFAULT false,
rollout_percentage INT NOT NULL DEFAULT 0 CHECK (rollout_percentage BETWEEN 0 AND 100),
target_tenant_slugs TEXT[] NOT NULL DEFAULT '{}',
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
@@ -0,0 +1 @@
DROP TABLE IF EXISTS policy_module_scopes;
@@ -0,0 +1,11 @@
-- Modul-Scoping fuer Policy-Regeln (RBAC-04, siehe core-kanban/tickets/RBAC-04.md).
-- Existiert fuer eine (role, permission)-Regel ein Eintrag hier, gilt sie
-- NUR, wenn zusaetzlich das verknuepfte Feature-Flag (LIC-02) fuer den
-- Tenant aktiv ist — Rechte folgen der Lizenz, nicht umgekehrt.
CREATE TABLE policy_module_scopes (
role TEXT NOT NULL,
permission TEXT NOT NULL,
module TEXT NOT NULL,
flag_key TEXT NOT NULL,
PRIMARY KEY (role, permission)
);