From 49faab5be5eafcca9392905bf5223c801a8d81f3 Mon Sep 17 00:00:00 2001 From: Brian Wiborg Date: Sat, 27 Sep 2025 16:18:52 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Allow=20admins=20on=20require=5F?= =?UTF-8?q?staff=20permission?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ohmyapi/builtin/auth/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ohmyapi/builtin/auth/routes.py b/src/ohmyapi/builtin/auth/routes.py index 3a9ea39..e1cb3cc 100644 --- a/src/ohmyapi/builtin/auth/routes.py +++ b/src/ohmyapi/builtin/auth/routes.py @@ -95,7 +95,7 @@ async def require_admin(current_user: User = Depends(get_current_user)) -> User: async def require_staff(current_user: User = Depends(get_current_user)) -> User: """Ensure the current user is a staff member.""" - if not current_user.is_staff: + if not current_user.is_admin and not current_user.is_staff: raise HTTPException(403, "Staff privileges required") return current_user