Fixed permission check

This commit is contained in:
Sven Heidemann 2023-02-19 14:25:41 +01:00
parent ba4ef693da
commit ef040f2b91
2 changed files with 3 additions and 3 deletions

@ -1 +1 @@
Subproject commit cae0f428182f686872a0799790479e9900f06cf5
Subproject commit 81021418c21d45cee54478ab5fd69f9ce7261644

View File

@ -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: