-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Permission Overwrites resolving incorrectly. #1253
Comments
That's not true at all, on the same level of overwrites an allow always takes precedence over a deny. Discord even confirms this on their permissions help page. I reproduced the setup you described in the last paragraph on a server with no other roles or overwrites and got the result that the member with the two roles was in fact able to send messages. |
bdistin
changed the title
Role Positions are not being accounted for, when resolving permission overwrites.
@ everyone role is overwriting specific role and user denys, when resolving permission overwrites.
Mar 8, 2017
bdistin
changed the title
@ everyone role is overwriting specific role and user denys, when resolving permission overwrites.
Permission Overwrites resolving incorrectly.
Mar 8, 2017
devsnek
pushed a commit
to devsnek/discord.js
that referenced
this issue
May 14, 2017
* Fix discordjs#1253 * apparently @ everyone role can be undefined * Fix oops * Fixes possible mutiple roles named '@everyone' * Clean up order/logic
devsnek
pushed a commit
to devsnek/discord.js
that referenced
this issue
May 14, 2017
* Fix discordjs#1253 * apparently @ everyone role can be undefined * Fix oops * Fixes possible mutiple roles named '@everyone' * Clean up order/logic
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Tested on latest Master.
The bug is in this particular code:for (const overwrite of overwrites.role.concat(overwrites.member)) { permissions &= ~overwrite.deny; allow |= overwrite.allow; } permissions |= allow;
This means any allows, no matter where the overwrite is positioned in the overwrites, will super-cede any denys. Which is a problem, because this is not how discord resolves permissions. Discord takes the overwrites for each permission at it's highest position of overwrites, and that is law.Given a member with 2 roles, the higher role has deny send_messages and the lower has allow send_messages; d.js will resolve allow send_messages when in-fact discord will deny send_messages.The text was updated successfully, but these errors were encountered: