Skip to content

Commit

Permalink
fix(Permissions): allow admin to override in the missing method (#5911)
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceEEC committed Jun 24, 2021
1 parent e0efcc6 commit ee025b0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/util/Permissions.js
Expand Up @@ -24,6 +24,16 @@ class Permissions extends BitField {
* @typedef {string|bigint|Permissions|PermissionResolvable[]} PermissionResolvable
*/

/**
* Gets all given bits that are missing from the bitfield.
* @param {BitFieldResolvable} bits Bit(s) to check for
* @param {boolean} [checkAdmin=true] Whether to allow the administrator permission to override
* @returns {string[]}
*/
missing(bits, checkAdmin = true) {
return checkAdmin && this.has(this.constructor.FLAGS.ADMINISTRATOR) ? [] : super.missing(bits, checkAdmin);
}

/**
* Checks whether the bitfield has a permission, or any of multiple permissions.
* @param {PermissionResolvable} permission Permission(s) to check for
Expand Down

0 comments on commit ee025b0

Please sign in to comment.