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
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:
1 parent
9d52aeab67
commit
4130a63dfe
15 files changed
+525
-14
No files matched your search
@@ -0,0 +1,9 @@
|
||||
"""
|
||||
Modul-Registrierungen für Rechte & Kontingente.
|
||||
|
||||
Neues Feature: eigene Datei oder Eintrag hier importieren — kein Eintrag in 079-Katalog-Migration.
|
||||
"""
|
||||
from rights_registrations import club_creation # noqa: F401
|
||||
from rights_registrations import exercises # noqa: F401
|
||||
from rights_registrations import planning # noqa: F401
|
||||
from rights_registrations import platform # noqa: F401
|
||||
@@ -0,0 +1,38 @@
|
||||
from rights_registry import CapabilityRegistration, register_capability
|
||||
|
||||
register_capability(
|
||||
CapabilityRegistration(
|
||||
id="club.creation_request.create",
|
||||
name="Vereinsgründung beantragen",
|
||||
domain="club",
|
||||
module="club_creation_requests",
|
||||
min_account_state="verified_pending_club",
|
||||
)
|
||||
)
|
||||
register_capability(
|
||||
CapabilityRegistration(
|
||||
id="club.creation_request.read_own",
|
||||
name="Eigene Gründungsanträge",
|
||||
domain="club",
|
||||
module="club_creation_requests",
|
||||
min_account_state="verified_pending_club",
|
||||
)
|
||||
)
|
||||
register_capability(
|
||||
CapabilityRegistration(
|
||||
id="club.creation_request.withdraw",
|
||||
name="Gründungsantrag zurückziehen",
|
||||
domain="club",
|
||||
module="club_creation_requests",
|
||||
min_account_state="verified_pending_club",
|
||||
)
|
||||
)
|
||||
register_capability(
|
||||
CapabilityRegistration(
|
||||
id="platform.club_creation.approve",
|
||||
name="Vereinsgründung freigeben",
|
||||
domain="platform",
|
||||
module="club_creation_requests",
|
||||
min_account_state="platform_admin",
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,90 @@
|
||||
"""Übungen-Modul: nur Rechte/Kontingente mit echter Endpoint-Verdrahtung."""
|
||||
from rights_registry import CapabilityRegistration, FeatureRegistration, register_capability, register_feature
|
||||
|
||||
_CLUB_WRITE_ROLES = (
|
||||
"club_admin",
|
||||
"trainer",
|
||||
"content_editor",
|
||||
"division_lead",
|
||||
)
|
||||
|
||||
register_feature(
|
||||
FeatureRegistration(
|
||||
id="ai_calls",
|
||||
name="KI-Aufrufe",
|
||||
module="exercises",
|
||||
category="ai",
|
||||
limit_type="count",
|
||||
reset_period="monthly",
|
||||
default_limit=0,
|
||||
description="KI-Aufrufe pro Monat (Suggest, Regenerate)",
|
||||
)
|
||||
)
|
||||
|
||||
register_capability(
|
||||
CapabilityRegistration(
|
||||
id="exercises.ai.suggest",
|
||||
name="KI-Vorschlag Übung",
|
||||
domain="exercises",
|
||||
module="exercises",
|
||||
linked_feature_id="ai_calls",
|
||||
default_club_grants=tuple((r, "exercises.ai.suggest") for r in _CLUB_WRITE_ROLES),
|
||||
)
|
||||
)
|
||||
register_capability(
|
||||
CapabilityRegistration(
|
||||
id="exercises.ai.regenerate",
|
||||
name="KI neu generieren",
|
||||
domain="exercises",
|
||||
module="exercises",
|
||||
linked_feature_id="ai_calls",
|
||||
default_club_grants=tuple((r, "exercises.ai.regenerate") for r in _CLUB_WRITE_ROLES),
|
||||
)
|
||||
)
|
||||
register_capability(
|
||||
CapabilityRegistration(
|
||||
id="exercises.create",
|
||||
name="Übung anlegen",
|
||||
domain="exercises",
|
||||
module="exercises",
|
||||
linked_feature_id="exercises",
|
||||
default_club_grants=tuple((r, "exercises.create") for r in _CLUB_WRITE_ROLES),
|
||||
)
|
||||
)
|
||||
register_capability(
|
||||
CapabilityRegistration(
|
||||
id="exercises.media.upload",
|
||||
name="Übungsmedien hochladen",
|
||||
domain="exercises",
|
||||
module="exercises",
|
||||
linked_feature_id="exercise_media",
|
||||
default_club_grants=(
|
||||
("club_admin", "exercises.media.upload"),
|
||||
("trainer", "exercises.media.upload"),
|
||||
("content_editor", "exercises.media.upload"),
|
||||
),
|
||||
)
|
||||
)
|
||||
|
||||
register_feature(
|
||||
FeatureRegistration(
|
||||
id="exercises",
|
||||
name="Übungen (Bestand)",
|
||||
module="exercises",
|
||||
category="content",
|
||||
limit_type="count",
|
||||
reset_period="never",
|
||||
default_limit=0,
|
||||
)
|
||||
)
|
||||
register_feature(
|
||||
FeatureRegistration(
|
||||
id="exercise_media",
|
||||
name="Übungsmedien",
|
||||
module="exercises",
|
||||
category="media",
|
||||
limit_type="count",
|
||||
reset_period="never",
|
||||
default_limit=0,
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,24 @@
|
||||
from rights_registry import CapabilityRegistration, FeatureRegistration, register_capability, register_feature
|
||||
|
||||
_PLANNING_ROLES = ("club_admin", "trainer", "division_lead")
|
||||
|
||||
register_capability(
|
||||
CapabilityRegistration(
|
||||
id="planning.ai.suggest",
|
||||
name="Planungs-KI Suggest",
|
||||
domain="planning",
|
||||
module="planning_exercise_suggest",
|
||||
linked_feature_id="ai_calls",
|
||||
default_club_grants=tuple((r, "planning.ai.suggest") for r in _PLANNING_ROLES),
|
||||
)
|
||||
)
|
||||
register_capability(
|
||||
CapabilityRegistration(
|
||||
id="planning.ai.progression_path",
|
||||
name="Planungs-KI Progressionspfad",
|
||||
domain="planning",
|
||||
module="planning_exercise_suggest",
|
||||
linked_feature_id="ai_calls",
|
||||
default_club_grants=tuple((r, "planning.ai.progression_path") for r in _PLANNING_ROLES),
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,21 @@
|
||||
"""Plattform-Modul: Admin-Zugang und Quota-Bypass (083)."""
|
||||
from rights_registry import CapabilityRegistration, register_capability
|
||||
|
||||
register_capability(
|
||||
CapabilityRegistration(
|
||||
id="platform.admin.access",
|
||||
name="Plattform-Admin-Bereich",
|
||||
domain="platform",
|
||||
module="platform",
|
||||
min_account_state="platform_admin",
|
||||
)
|
||||
)
|
||||
register_capability(
|
||||
CapabilityRegistration(
|
||||
id="platform.club_quota.bypass",
|
||||
name="Vereins-Kontingent-Bypass",
|
||||
domain="quota_bypass",
|
||||
module="platform",
|
||||
min_account_state="platform_admin",
|
||||
)
|
||||
)
|
||||
Reference in new issue
Block a user