Skip to content

Commit

Permalink
Fix administrator permission check (#1028)
Browse files Browse the repository at this point in the history
Fixed a bug where giving the @everyone role administrator doesn't override permissions
  • Loading branch information
spiral authored Nov 29, 2020
1 parent 124c97e commit fb06856
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/structures/Guild.js
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,9 @@ class Guild extends Base {
return new Permission(Permissions.all);
} else {
let permissions = this.roles.get(this.id).permissions.allow;
if(permissions & Permissions.administrator) {
return new Permission(Permissions.all);
}
for(let role of member.roles) {
role = this.roles.get(role);
if(!role) {
Expand Down

0 comments on commit fb06856

Please sign in to comment.