add get users
This commit is contained in:
@@ -21,4 +21,8 @@ class UserService(BaseService):
|
||||
user = await self.get_user_by_username_or_raise(username)
|
||||
if not user.is_superuser:
|
||||
raise HTTPException(status_code=403, detail="Admin access required")
|
||||
return user
|
||||
return user
|
||||
|
||||
async def get_all_users(self) -> list[User]:
|
||||
users = await self.session.user.get_all_users()
|
||||
return [User.model_validate(user) for user in users]
|
||||
|
||||
Reference in New Issue
Block a user