Update Membership RBAC Decisions and Enhance Admin Rights Management
Deploy Development / deploy (push) Successful in 44s
Test Suite / pytest-backend (push) Successful in 43s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 14s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m13s
Deploy Development / deploy (push) Successful in 44s
Test Suite / pytest-backend (push) Successful in 43s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 14s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m13s
- Updated the Membership RBAC Decisions document to reflect the latest implementation status and roadmap, including new features and enhancements. - Incremented application version to 0.8.200 and updated database schema version to 20260606083. - Added a new API endpoint to clear capability grants for club roles, improving admin rights management. - Enhanced the Admin Rights page in the frontend to display enforcement status and feature consumption details for capabilities. - Improved the user interface for better clarity on rights and capabilities management.
This commit is contained in:
1 parent
b68185842e
commit
9d52aeab67
7 files changed
+448
-124
No files matched your search
@@ -15,6 +15,10 @@ from club_quota_bypass import (
|
||||
list_quota_bypass_grants,
|
||||
quota_bypass_capability_id_for_feature,
|
||||
)
|
||||
from capability_enforcement_audit import (
|
||||
enforcement_status_for_capability,
|
||||
feature_consume_status,
|
||||
)
|
||||
from club_tenancy import is_superadmin
|
||||
from db import get_db, get_cursor, r2d
|
||||
|
||||
@@ -94,7 +98,13 @@ def get_capability_matrix(session: dict = Depends(require_auth)):
|
||||
ORDER BY domain, id
|
||||
"""
|
||||
)
|
||||
capabilities = [r2d(r) for r in cur.fetchall()]
|
||||
capabilities = []
|
||||
for row in cur.fetchall():
|
||||
cap = r2d(row)
|
||||
cap["enforcement"] = enforcement_status_for_capability(cap.get("id"))
|
||||
if cap.get("linked_feature_id"):
|
||||
cap["feature_consume"] = feature_consume_status(cap["linked_feature_id"])
|
||||
capabilities.append(cap)
|
||||
|
||||
cur.execute(
|
||||
"""
|
||||
@@ -224,6 +234,27 @@ def add_club_role_capability_grant(
|
||||
return r2d(row)
|
||||
|
||||
|
||||
@router.delete("/capability-grants/club-roles/by-capability")
|
||||
def clear_club_capability_grants(
|
||||
capability_id: str = Query(...),
|
||||
session: dict = Depends(require_auth),
|
||||
):
|
||||
"""Alle Rollen-Grants einer Capability entfernen → wieder offen für alle Mitglieder."""
|
||||
_require_superadmin(session)
|
||||
cap_id = capability_id.strip()
|
||||
with get_db() as conn:
|
||||
cur = get_cursor(conn)
|
||||
cur.execute(
|
||||
"""
|
||||
DELETE FROM club_role_capability_grants
|
||||
WHERE capability_id = %s
|
||||
""",
|
||||
(cap_id,),
|
||||
)
|
||||
conn.commit()
|
||||
return {"ok": True, "capability_id": cap_id}
|
||||
|
||||
|
||||
@router.delete("/capability-grants/club-roles")
|
||||
def delete_club_role_capability_grant(
|
||||
role_code: str = Query(...),
|
||||
|
||||
Reference in new issue
Block a user