Fix permissions check to use any instead of all permissions
This commit is contained in:
parent
e9532d1235
commit
cd49bd9e78
1 changed files with 3 additions and 1 deletions
|
@ -22,6 +22,8 @@ def admin_or_permissions(*perms: list) -> bool:
|
||||||
|
|
||||||
async def predicate(ctx: Context) -> bool:
|
async def predicate(ctx: Context) -> bool:
|
||||||
"""Extended check predicate.""" # noqa: D401
|
"""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
|
return predicate
|
||||||
|
|
Loading…
Add table
Reference in a new issue