Implement Registry-First Approach for Rights and Capabilities Management
Deploy Development / deploy (push) Successful in 44s
Test Suite / pytest-backend (push) Successful in 42s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 35s
Test Suite / playwright-tests (push) Successful in 1m51s

- Updated the capability catalog to reflect a registry-first approach, requiring modules to register rights and quotas upon implementation.
- Enhanced the backend to synchronize the rights registry with the database, ensuring only registered capabilities and features are displayed in the admin matrix.
- Modified SQL queries in the admin rights router to filter capabilities and features based on module registration.
- Updated documentation to clarify the new rights and features registry process, replacing the previous catalog-first method.
- Incremented application version to 0.8.201 and updated database schema version to 20260606084 to reflect these changes.
This commit is contained in:
Lars committed 2026-06-07 15:36:31 +02:00
1 parent 9d52aeab67
commit 4130a63dfe
15 files changed
+525 -14

No files matched your search

+11 -5
View File
@@ -92,10 +92,10 @@ def get_capability_matrix(session: dict = Depends(require_auth)):
cur = get_cursor(conn)
cur.execute(
"""
SELECT id, name, domain, min_account_state, linked_feature_id
SELECT id, name, domain, min_account_state, linked_feature_id, module
FROM capabilities
WHERE active = true
ORDER BY domain, id
WHERE active = true AND module IS NOT NULL
ORDER BY module, domain, id
"""
)
capabilities = []
@@ -130,6 +130,11 @@ def get_capability_matrix(session: dict = Depends(require_auth)):
"capabilities": capabilities,
"portal_grants": portal_grants,
"club_role_grants": club_role_grants,
"registry_only": True,
"hint": (
"Nur vom Modul registrierte Rechte (capabilities.module). "
"Legacy-Katalog-Seed ohne module erscheint nicht."
),
}
@@ -453,10 +458,11 @@ def get_club_plans_matrix(session: dict = Depends(require_auth)):
cur.execute(
"""
SELECT id, name, description, category, limit_type, reset_period, default_limit
SELECT id, name, description, category, limit_type, reset_period, default_limit, module
FROM features
WHERE app = 'shinkan' AND active = true AND enforcement_subject = 'club'
ORDER BY category, id
AND module IS NOT NULL
ORDER BY module, category, id
"""
)
features = [r2d(r) for r in cur.fetchall()]