Fixed permission handling for member data #256 #258

Merged
edraft merged 1 commits from #256 into 1.0.0 2023-03-25 18:01:58 +01:00
Showing only changes of commit 87b277515c - Show all commits

View File

@ -124,28 +124,36 @@ class QueryABC(ObjectType):
elif type(element) == User:
for u in user.users:
u: User = u
if u.id == element.id:
guild = bot.get_guild(u.server.discord_id)
member = guild.get_member(u.discord_id)
if u.id == element.id or permissions.is_member_moderator(member):
access = True
break
elif type(element) == UserJoinedServer:
for u in user.users:
u: User = u
if u.id == element.user.id:
guild = bot.get_guild(u.server.discord_id)
member = guild.get_member(u.discord_id)
if u.id == element.id or permissions.is_member_moderator(member):
access = True
break
elif type(element) == UserJoinedVoiceChannel:
for u in user.users:
u: User = u
if u.id == element.user.id:
guild = bot.get_guild(u.server.discord_id)
member = guild.get_member(u.discord_id)
if u.id == element.id or permissions.is_member_moderator(member):
access = True
break
elif type(element) == UserJoinedGameServer:
for u in user.users:
u: User = u
if u.id == element.user.id:
guild = bot.get_guild(u.server.discord_id)
member = guild.get_member(u.discord_id)
if u.id == element.id or permissions.is_member_moderator(member):
access = True
break