diff --git a/kdb-bot/src/bot_graphql/abc/query_abc.py b/kdb-bot/src/bot_graphql/abc/query_abc.py index 22db1896..67692585 100644 --- a/kdb-bot/src/bot_graphql/abc/query_abc.py +++ b/kdb-bot/src/bot_graphql/abc/query_abc.py @@ -10,6 +10,7 @@ from bot_api.exception.service_error_code_enum import ServiceErrorCode from bot_api.exception.service_exception import ServiceException from bot_api.route.route import Route from bot_core.configuration.feature_flags_enum import FeatureFlagsEnum +from bot_data.model.achievement import Achievement from bot_data.model.auth_role_enum import AuthRoleEnum from bot_data.model.auth_user import AuthUser from bot_data.model.auto_role import AutoRole @@ -78,7 +79,17 @@ class QueryABC(ObjectType): bot: DiscordBotServiceABC = services.get_service(DiscordBotServiceABC) access = False - if type(element) == AutoRole: + if type(element) == Achievement: + element: Achievement = 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) == AutoRole: element: AutoRole = element for u in user.users: u: User = u