Fixed permission check
All checks were successful
Deploy dev on push / on-push-deploy_sh-edraft (push) Successful in 4m3s
All checks were successful
Deploy dev on push / on-push-deploy_sh-edraft (push) Successful in 4m3s
This commit is contained in:
parent
3fd25418bf
commit
682c0034b0
@ -47,11 +47,15 @@ class PermissionService(PermissionServiceABC):
|
|||||||
return self._team_role_members(g_id, TeamMemberTypeEnum.moderator)
|
return self._team_role_members(g_id, TeamMemberTypeEnum.moderator)
|
||||||
|
|
||||||
def is_member_admin(self, member: discord.Member) -> bool:
|
def is_member_admin(self, member: discord.Member) -> bool:
|
||||||
return member in self.get_admins(member.guild.id)
|
return member is not None and member in self.get_admins(member.guild.id)
|
||||||
|
|
||||||
def is_member_moderator(self, member: discord.Member) -> bool:
|
def is_member_moderator(self, member: discord.Member) -> bool:
|
||||||
return member in self.get_admins(member.guild.id) or member in self.get_moderators(member.guild.id)
|
return (
|
||||||
|
member is not None
|
||||||
|
and member in self.get_admins(member.guild.id)
|
||||||
|
or member in self.get_moderators(member.guild.id)
|
||||||
|
)
|
||||||
|
|
||||||
def is_member_technician(self, member: discord.Member) -> bool:
|
def is_member_technician(self, member: discord.Member) -> bool:
|
||||||
config = self._technician_configs.get_technician_config()
|
config = self._technician_configs.get_technician_config()
|
||||||
return str(member.id) in config.technician_ids.select(lambda x: str(x))
|
return member is not None and str(member.id) in config.technician_ids.select(lambda x: str(x))
|
||||||
|
Loading…
Reference in New Issue
Block a user