fix(Permissions): toArray shouldn't check admin (#7144)

This commit is contained in:
D Trombett
2021-12-26 15:46:35 +01:00
committed by GitHub
parent 7e5f16b6b3
commit fc4292e2e9
2 changed files with 10 additions and 2 deletions

View File

@@ -31,7 +31,7 @@ class Permissions extends BitField {
* @returns {string[]}
*/
missing(bits, checkAdmin = true) {
return checkAdmin && this.has(this.constructor.FLAGS.ADMINISTRATOR) ? [] : super.missing(bits, checkAdmin);
return checkAdmin && this.has(this.constructor.FLAGS.ADMINISTRATOR) ? [] : super.missing(bits);
}
/**
@@ -53,6 +53,14 @@ class Permissions extends BitField {
has(permission, checkAdmin = true) {
return (checkAdmin && super.has(this.constructor.FLAGS.ADMINISTRATOR)) || super.has(permission);
}
/**
* Gets an {@link Array} of bitfield names based on the permissions available.
* @returns {string[]}
*/
toArray() {
return super.toArray(false);
}
}
/**