From ef040f2b91abadfd1b12bb2cf5c5e1e9aeb5c573 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Sun, 19 Feb 2023 14:25:41 +0100 Subject: [PATCH] Fixed permission check --- kdb-bot/src/bot_api/config | 2 +- kdb-bot/src/bot_api/transformer/auth_user_transformer.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kdb-bot/src/bot_api/config b/kdb-bot/src/bot_api/config index cae0f428..81021418 160000 --- a/kdb-bot/src/bot_api/config +++ b/kdb-bot/src/bot_api/config @@ -1 +1 @@ -Subproject commit cae0f428182f686872a0799790479e9900f06cf5 +Subproject commit 81021418c21d45cee54478ab5fd69f9ce7261644 diff --git a/kdb-bot/src/bot_api/transformer/auth_user_transformer.py b/kdb-bot/src/bot_api/transformer/auth_user_transformer.py index 09e6495c..7c39ac2b 100644 --- a/kdb-bot/src/bot_api/transformer/auth_user_transformer.py +++ b/kdb-bot/src/bot_api/transformer/auth_user_transformer.py @@ -43,14 +43,14 @@ class AuthUserTransformer(TransformerABC): def _is_admin(user: User, bot: DiscordBotServiceABC, permissions: PermissionServiceABC): guild = bot.get_guild(user.server.discord_id) member = guild.get_member(user.discord_id) - return permissions.is_member_technician(member) + return permissions.is_member_admin(member) @staticmethod @ServiceProviderABC.inject def _is_moderator(user: User, bot: DiscordBotServiceABC, permissions: PermissionServiceABC): guild = bot.get_guild(user.server.discord_id) member = guild.get_member(user.discord_id) - return permissions.is_member_technician(member) + return permissions.is_member_moderator(member) @classmethod def to_dto(cls, db: AuthUser, password: str = None) -> AuthUserDTO: