Administrator Permission does not grant all other permissions
Created by: SakuraIsayeki
Discovered by @cmsteffey, @VelvetThePanda, and @SakuraIsayeki.
Summary
The Administrator 0x8
permission, which is attributed server-wide, does not systematically grant all other permissions when checked against in DSharpPlus. This means that a user who's granted 0x8
permission on server might not be eligible for other permission checks in the library, where it nominally should.
Details
Issue is library-bound, and affects all environments in Guild-related operations. this has no effect for DM-based operations, given lack of permissions.
Steps to reproduce
- Create a server role with
0x8
permission and grant it to a specific server user - Server User enters a command reserved for another permission (ManageServer for example)
- Command fails by user permissions denial, where it should be granted to the server user.
Notes
Here's an excerpt from a conversation in official discord server, with @cmsteffey, who proposes several solutions :
The other bit fields are not filled, but their permissions are still given - and the library doesn't account for that. There are two ways of doing this - have HasPermissions return true always if the
8
bit is filled - or, have the library convert any permission value with the8
bit converted into!0
.