Fixed getBit

will now resolve all permissions to true if it has manage role
This commit is contained in:
hydrabolt
2015-10-26 12:11:45 +00:00
parent 0f02856a8c
commit 15f35e8019
6 changed files with 35 additions and 4 deletions

View File

@@ -53,6 +53,9 @@ var ChannelPermissions = (function () {
};
ChannelPermissions.prototype.getBit = function getBit(x) {
if ((this.packed >>> 3 & 1) === 1) {
return true;
}
return (this.packed >>> x & 1) === 1;
};

View File

@@ -38,6 +38,9 @@ var EvaluatedPermissions = (function () {
};
EvaluatedPermissions.prototype.getBit = function getBit(x) {
if ((this.packed >>> 3 & 1) === 1) {
return true;
}
return (this.packed >>> x & 1) === 1;
};

View File

@@ -42,11 +42,20 @@ var ServerPermissions = (function () {
};
ServerPermissions.prototype.getBit = function getBit(x) {
if ((this.packed >>> 3 & 1) === 1) {
return true;
}
return (this.packed >>> x & 1) === 1;
};
ServerPermissions.prototype.setBit = function setBit() {
//dummy function for now
ServerPermissions.prototype.setBit = function setBit(location, value) {
if (value) {
// allow that permission
} else {
// not allowed
}
};
ServerPermissions.prototype.toString = function toString() {