Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[V3] local blacklist ignores roles #2133

Closed
Lunatrius opened this issue Sep 15, 2018 · 1 comment · Fixed by #2134
Closed

[V3] local blacklist ignores roles #2133

Lunatrius opened this issue Sep 15, 2018 · 1 comment · Fixed by #2134
Labels
Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing.

Comments

@Lunatrius
Copy link

Command bugs

Command name

localblacklist

What cog is this command from?

core

What were you expecting to happen?

Adding a role to the local blacklist would/should disallow the person to use commands.

What actually happened?

The user with the blacklisted role could sue the command without issues.

How can we reproduce this issue?

  1. Blacklist a role
  2. Assign the role to someone and let them use any command

Code

Support for blacklisting roles was added here:

try:
obj = await commands.MemberConverter().convert(ctx, user_or_role)
except commands.BadArgument:
obj = await commands.RoleConverter().convert(ctx, user_or_role)
user = False
else:
user = True

But it looks like it was missed during the actual check:

_ids = [r.id for r in ctx.author.roles if not r.is_default]
_ids.append(ctx.author.id)
if local_whitelist:
return any(i in local_whitelist for i in _ids)
return not any(i in local_blacklist for i in _ids)

@Kowlin Kowlin added Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing. V3 Status: In Progress There's a PR open to deal with this, or an org member is working on this internally labels Sep 15, 2018
Tobotimus pushed a commit that referenced this issue Sep 17, 2018
fixes #2133 , 

`discord.Role.is_default` is a method, not a property.
@Tobotimus
Copy link
Member

Resolved by #2134.

@Tobotimus Tobotimus removed Status: Needs Info Needs more info, probably from the author. Status: In Progress There's a PR open to deal with this, or an org member is working on this internally labels Oct 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants