Improved can see permission for admin and technician

This commit is contained in:
Sven Heidemann 2023-10-02 07:41:15 +02:00
parent ef0fab1178
commit 3b79a61bb6

View File

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