first
This commit is contained in:
10
sop-back/app/core/deps.py
Normal file
10
sop-back/app/core/deps.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from fastapi import HTTPException, status
|
||||
from app.core.config import settings
|
||||
|
||||
|
||||
def require_admin() -> None:
|
||||
if not settings.ADMIN_ENABLED:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
detail="Admin module is disabled",
|
||||
)
|
||||
Reference in New Issue
Block a user