From 3b79a61bb65e5e48ef1e9385b5da27c7dec9dc7a Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Mon, 2 Oct 2023 07:41:15 +0200 Subject: [PATCH] Improved can see permission for admin and technician --- kdb-bot/src/bot_graphql/abc/query_abc.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kdb-bot/src/bot_graphql/abc/query_abc.py b/kdb-bot/src/bot_graphql/abc/query_abc.py index 7a397f42..1a566a94 100644 --- a/kdb-bot/src/bot_graphql/abc/query_abc.py +++ b/kdb-bot/src/bot_graphql/abc/query_abc.py @@ -79,6 +79,14 @@ class QueryABC(ObjectType): permissions: PermissionService = services.get_service(PermissionService) bot: DiscordBotServiceABC = services.get_service(DiscordBotServiceABC) + if user.auth_role == AuthRoleEnum.admin: + return True + + for u in user.users: + guild = bot.get_guild(u.server.discord_id) + if permissions.is_member_technician(guild.get_member(u.discord_id)): + return True + access = False if type(element) == Achievement: element: Achievement = element