refactor: align backend with company-site-member schema and system-level RBAC groups

This commit is contained in:
Chris
2026-03-30 01:59:50 +08:00
parent f5848a360f
commit f9ad9417ba
37 changed files with 1361 additions and 966 deletions

View File

@@ -58,9 +58,8 @@ def get_permission_snapshot(
if user is None:
return PermissionSnapshotResponse(authentik_sub=authentik_sub, permissions=[])
permissions = perms_repo.list_by_user_id(user.id)
tuples = [(p.scope_type, p.scope_id, p.module, p.action) for p in permissions]
return PermissionService.build_snapshot(authentik_sub=authentik_sub, permissions=tuples)
permissions = perms_repo.list_by_user(user.id, user.authentik_sub)
return PermissionService.build_snapshot(authentik_sub=authentik_sub, permissions=permissions)
@router.post("/authentik/users/ensure", response_model=AuthentikEnsureUserResponse)