From 4c0a4bc1ae6fc1ea592356aae53a76a09a584f70 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 28 Sep 2023 10:54:04 +0200 Subject: [PATCH] Added can see check #378 --- kdb-bot/src/bot_graphql/abc/query_abc.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kdb-bot/src/bot_graphql/abc/query_abc.py b/kdb-bot/src/bot_graphql/abc/query_abc.py index 67692585..7a397f42 100644 --- a/kdb-bot/src/bot_graphql/abc/query_abc.py +++ b/kdb-bot/src/bot_graphql/abc/query_abc.py @@ -20,6 +20,7 @@ from bot_data.model.known_user import KnownUser from bot_data.model.level import Level from bot_data.model.server import Server from bot_data.model.server_config import ServerConfig +from bot_data.model.short_role_name import ShortRoleName from bot_data.model.user import User from bot_data.model.user_joined_game_server import UserJoinedGameServer from bot_data.model.user_joined_server import UserJoinedServer @@ -184,6 +185,16 @@ class QueryABC(ObjectType): access = True break + elif type(element) == ShortRoleName: + element: ShortRoleName = element + for u in user.users: + u: User = u + guild = bot.get_guild(u.server.discord_id) + member = guild.get_member(u.discord_id) + if permissions.is_member_moderator(member) and u.server.id == element.server.id: + access = True + break + elif type(element) == dict and "key" in element and element["key"] in [e.value for e in FeatureFlagsEnum]: for u in user.users: u: User = u