fix permissions not resolving correctly (#1928)

This commit is contained in:
bdistin
2017-09-10 10:27:04 -05:00
committed by Amish Shah
parent 3767b35189
commit 98b81fac38

View File

@@ -57,7 +57,7 @@ class Permissions {
let total = 0;
for (let p = permissions.length - 1; p >= 0; p--) {
const perm = this.constructor.resolve(permissions[p]);
if ((this.bitfield & perm) !== perm) total |= perm;
total |= perm;
}
if (Object.isFrozen(this)) return new this.constructor(this.bitfield | total);
this.bitfield |= total;
@@ -73,7 +73,7 @@ class Permissions {
let total = 0;
for (let p = permissions.length - 1; p >= 0; p--) {
const perm = this.constructor.resolve(permissions[p]);
if ((this.bitfield & perm) === perm) total |= perm;
total |= perm;
}
if (Object.isFrozen(this)) return new this.constructor(this.bitfield & ~total);
this.bitfield &= ~total;