feat: iam rbac system
Endpoints and db architecture to support a role based IAM system.
This commit is contained in:
parent
7b3ee9d5fa
commit
23f2ce98d7
31 changed files with 634 additions and 317 deletions
|
|
@ -8,4 +8,21 @@ Classes:
|
|||
Functions:
|
||||
- List: Description
|
||||
- Functions: Description
|
||||
"""
|
||||
"""
|
||||
from typing import Annotated
|
||||
|
||||
from fastapi import HTTPException, Depends
|
||||
|
||||
from src.database import db_dependency
|
||||
|
||||
from src.organisation.models import Organisation as Org
|
||||
|
||||
|
||||
def get_org_model(db: db_dependency, org_id: int) -> type[Org]:
|
||||
org_model = db.query(Org).filter(Org.id == org_id).first()
|
||||
if org_model is None:
|
||||
raise HTTPException(status_code=404, detail="Organisation not found")
|
||||
|
||||
return org_model
|
||||
|
||||
org_model_dependency = Annotated[type[Org], Depends(get_org_model)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue