diff options
| author | Zeyla Hellyer <[email protected]> | 2018-01-05 22:26:47 -0800 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2018-01-05 22:27:28 -0800 |
| commit | 7566f32c194bc4e62e89adc57bfb6104cc99458e (patch) | |
| tree | 2caf37e1fbe2343752943969f5b26eacff63b131 /examples | |
| parent | Fix help-commands' `plain` (diff) | |
| download | serenity-7566f32c194bc4e62e89adc57bfb6104cc99458e.tar.xz serenity-7566f32c194bc4e62e89adc57bfb6104cc99458e.zip | |
Fix permission overwrites in permission building
While building permissions in the `Guild::permissions_in` function -
which is relied upon by most model functions to check CurrentUser
permissions - the channel overwrites of the given channel were iterated
over incorrectly.
The channel overwrites were iterated over in a non-specified order,
resulting in overwrites being applied in a random order. However,
Discord operates by applying permissions from a down-top order: role ID
0 is below role ID 1, which is below role ID 2, etc. This means that
prior to applying permissions we must first sort by position so that
lower positioned roles are iterated over first.
Diffstat (limited to 'examples')
0 files changed, 0 insertions, 0 deletions