Fix permissions check to use any instead of all permissions

This commit is contained in:
Zeva Rose 2022-02-02 19:44:53 -07:00
parent e9532d1235
commit cd49bd9e78

View file

@ -22,6 +22,8 @@ def admin_or_permissions(*perms: list) -> bool:
async def predicate(ctx: Context) -> bool:
"""Extended check predicate.""" # noqa: D401
return ctx.author.has_permission(Permissions.ADMINISTRATOR) or ctx.author.has_permission(*perms)
is_admin = ctx.author.has_permission(Permissions.ADMINISTRATOR)
has_other = any(ctx.author.has_permission(perm) for perm in perms)
return is_admin or has_other
return predicate