AP0.3: Capability Registry, Entitlements-Snapshot und require_capability.
Deploy Development / deploy (push) Successful in 33s
Test Suite / pytest-backend (push) Failing after 4s
Test Suite / k6 /api/health Baseline (push) Has been skipped
Test Suite / playwright-smoke (push) Has been skipped
Test Suite / lint-backend (push) Successful in 1s
Test Suite / compose-smoke (push) Has been skipped
Deploy Development / deploy (push) Successful in 33s
Test Suite / pytest-backend (push) Failing after 4s
Test Suite / k6 /api/health Baseline (push) Has been skipped
Test Suite / playwright-smoke (push) Has been skipped
Test Suite / lint-backend (push) Successful in 1s
Test Suite / compose-smoke (push) Has been skipped
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
f9c207c4f6
commit
910b1d7e07
19 files changed
+788
-8
No files matched your search
@@ -0,0 +1,23 @@
|
||||
-- AP0.3: Capability catalog and role → capability grants
|
||||
|
||||
CREATE TABLE capabilities (
|
||||
capability_key VARCHAR(128) PRIMARY KEY,
|
||||
module VARCHAR(64) NOT NULL,
|
||||
description TEXT NOT NULL,
|
||||
is_active BOOLEAN NOT NULL DEFAULT TRUE,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||
);
|
||||
|
||||
CREATE TABLE role_capability_grants (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
role_scope VARCHAR(16) NOT NULL
|
||||
CHECK (role_scope IN ('portal', 'tenant')),
|
||||
role_code VARCHAR(32) NOT NULL,
|
||||
capability_key VARCHAR(128) NOT NULL REFERENCES capabilities(capability_key) ON DELETE CASCADE,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||
UNIQUE (role_scope, role_code, capability_key)
|
||||
);
|
||||
|
||||
CREATE INDEX idx_role_capability_grants_lookup
|
||||
ON role_capability_grants(role_scope, role_code);
|
||||
Reference in new issue
Block a user