From 5e8f3048f925a4cdb26661e9757b14a78f70d6ce Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sun, 22 Dec 2024 19:47:40 -0700 Subject: [PATCH] refac --- backend/open_webui/routers/channels.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/routers/channels.py b/backend/open_webui/routers/channels.py index c73c601f7..90b0cde59 100644 --- a/backend/open_webui/routers/channels.py +++ b/backend/open_webui/routers/channels.py @@ -32,7 +32,10 @@ router = APIRouter() @router.get("/", response_model=list[ChannelModel]) async def get_channels(user=Depends(get_verified_user)): - return Channels.get_channels() + if user.role == "admin": + return Channels.get_channels() + else: + return Channels.get_channels_by_user_id(user.id) ############################