summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/api/moderation.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/api/moderation.py')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/api/moderation.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/api/moderation.py b/packages/meshbay-hub/src/meshbay_hub/api/moderation.py
index a8bf84f..6bb007b 100644
--- a/packages/meshbay-hub/src/meshbay_hub/api/moderation.py
+++ b/packages/meshbay-hub/src/meshbay_hub/api/moderation.py
@@ -27,7 +27,7 @@ from pydantic import BaseModel
from sqlalchemy import func, select
from sqlalchemy.ext.asyncio import AsyncSession
-from meshbay_hub.api.deps import get_current_user
+from meshbay_hub.api.deps import get_current_user, require_admin
from meshbay_hub.db.engine import get_db
from meshbay_hub.db.models import ContentBlocklist, ContentReport, User
@@ -138,7 +138,7 @@ async def get_blocklist(
@router.get("/v1/admin/blocklist")
async def admin_list_blocklist(
- current_user: User = Depends(get_current_user),
+ current_user: User = Depends(require_admin),
db: AsyncSession = Depends(get_db),
limit: int = 500,
):
@@ -164,7 +164,7 @@ async def admin_list_blocklist(
@router.post("/v1/admin/blocklist", status_code=201)
async def admin_add_blocklist(
body: BlocklistAddRequest,
- current_user: User = Depends(get_current_user),
+ current_user: User = Depends(require_admin),
db: AsyncSession = Depends(get_db),
):
existing = await db.get(ContentBlocklist, body.content_hash)
@@ -183,7 +183,7 @@ async def admin_add_blocklist(
@router.delete("/v1/admin/blocklist/{content_hash}", status_code=200)
async def admin_remove_blocklist(
content_hash: str,
- current_user: User = Depends(get_current_user),
+ current_user: User = Depends(require_admin),
db: AsyncSession = Depends(get_db),
):
entry = await db.get(ContentBlocklist, content_hash)