11 lines
287 B
Python
11 lines
287 B
Python
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from fastapi import HTTPException, status
|
||
|
|
|
||
|
|
from app.core.auth import AuthContext
|
||
|
|
|
||
|
|
|
||
|
|
def require_admin(auth: AuthContext) -> None:
|
||
|
|
if auth.actor_type != "user" or auth.user is None:
|
||
|
|
raise HTTPException(status_code=status.HTTP_403_FORBIDDEN)
|