feat: implement multi-tenancy governance and enhance club member management
- Bumped application version to 0.8.17, reflecting updates in both backend and frontend. - Introduced governance visibility for training plan templates and framework programs, allowing access based on visibility settings (private, club, official). - Added API endpoints for managing club members, including listing, adding, updating, and removing members. - Updated changelog to document the new features and changes made in this release.
This commit is contained in:
1 parent
c7bf7dcd9d
commit
7d476268b8
9 files changed
+501
-45
No files matched your search
@@ -96,6 +96,30 @@ def memberships_with_roles(cur, profile_id: int) -> List[Dict[str, Any]]:
|
||||
return out
|
||||
|
||||
|
||||
_GOVERNANCE_VISIBILITY = frozenset({"private", "club", "official"})
|
||||
|
||||
|
||||
def assert_valid_governance_visibility(
|
||||
cur,
|
||||
profile_id: int,
|
||||
role: Optional[str],
|
||||
visibility: str,
|
||||
club_id: Optional[int],
|
||||
) -> None:
|
||||
"""Pflicht club_id bei visibility=club + Mitgliedschaft; official nur Plattform-Admin."""
|
||||
if visibility not in _GOVERNANCE_VISIBILITY:
|
||||
raise HTTPException(status_code=400, detail="Ungültige visibility")
|
||||
if visibility == "official" and not is_platform_admin(role):
|
||||
raise HTTPException(
|
||||
status_code=403,
|
||||
detail="Nur Plattform-Admins dürfen offizielle Inhalte setzen",
|
||||
)
|
||||
if visibility == "club":
|
||||
if club_id is None:
|
||||
raise HTTPException(status_code=400, detail="club_id ist bei visibility=club erforderlich")
|
||||
assert_club_member(cur, profile_id, club_id)
|
||||
|
||||
|
||||
def exercise_visible_to_profile(
|
||||
cur,
|
||||
profile_id: int,
|
||||
|
||||
Reference in new issue
Block a user