Open schnapster opened 7 years ago
You can get permissions without the special cases by using PermissionUtil.getExplicitPermissions(...)
Thanks, I shall use that then. Wasn't aware this was in JDA since I never really looked at PermissionUtil due to it being a JDA internal class. Guess these methods aren't about to change significantly?
PermissionUtil will likely not be updated until a new permission change is made by discord. This is likely to happen with the release of channel categories.
Since we've been waiting half a year for a change in channel permissions, I updated the handling for now to properly respect the current (bad) channel permission system.
This is available in build 333
and will be in the next release unless something in the permissions on discord's end changes first (who am I kidding).
This issue will stay open to keep track of this problem as it is still an issue on discord's end which needs to be fixed.
This has been resolved in release 3.5.1 I will keep this issue open until discord fixes their permissions
This can be closed now, Discord fixed the permission leak by not allowing users with manage roles to grant permissions they don't already possess.
Example: Screenshot of trying to edit a role's permissions while using a role with only manage roles permission activated. (And some basic permissions inherited from @everyone
)
If this is indeed the case then PermissionUtil
will need to be re-evaluated to see if the situation has changed and if we need to modify our functionality to match the now-fixed functionality.
I think this issue can now be closed, no?
I'm getting a lot of these:
To reproduce: Give the bot the "Manage Roles" permission, and try to do something like clearing Emojis from a message. The problem here is, that I can't even check this in front of, because JDA will tell me that yes, it does have permissions to Manage Messages only to then error out when
queue()
ing that action. @MinnDevelopment explained it to me like this:and that this was an inconsistency in handling permissions on Discords side.
So how can I know in this case in advance that I am missing a permission?