Adding audit log
This commit is contained in:
1 parent
fe6f9cca05
commit
45bc5bf8f6
18 files changed
+543
-119
No files matched your search
@@ -0,0 +1,19 @@
|
||||
from fastapi import APIRouter, Depends
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from app.core.database import get_db
|
||||
from app.crud import audit as audit_crud
|
||||
from app.deps import require_permission
|
||||
from app.models.user import User
|
||||
from app.schemas.audit_log import AuditLogRead
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.get("", response_model=list[AuditLogRead])
|
||||
async def list_audit_log(
|
||||
limit: int = 200,
|
||||
db: AsyncSession = Depends(get_db),
|
||||
_: User = Depends(require_permission("audit_log:read")),
|
||||
):
|
||||
return await audit_crud.list_recent(db, limit=limit)
|
||||
Reference in new issue
Block a user