feat: bootstrap backend MVP and architecture docs
This commit is contained in:
1
app/services/__init__.py
Normal file
1
app/services/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
"""Service layer."""
|
||||
13
app/services/permission_service.py
Normal file
13
app/services/permission_service.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from app.schemas.permissions import PermissionItem, PermissionSnapshotResponse
|
||||
|
||||
|
||||
class PermissionService:
|
||||
@staticmethod
|
||||
def build_snapshot(authentik_sub: str, permissions: list[tuple[str, str, str, str]]) -> PermissionSnapshotResponse:
|
||||
return PermissionSnapshotResponse(
|
||||
authentik_sub=authentik_sub,
|
||||
permissions=[
|
||||
PermissionItem(scope_type=s_type, scope_id=s_id, module=module, action=action)
|
||||
for s_type, s_id, module, action in permissions
|
||||
],
|
||||
)
|
||||
Reference in New Issue
Block a user