summary refs log tree commit diff
path: root/src/util/Permissions.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-21 17:48:20 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-21 17:48:20 +0200
commitf456a9b1f3175c298644be276be01f79027e9d5d (patch)
tree1b372faf63291744597baaabb7363ead5857ba28 /src/util/Permissions.ts
parent:sparkles: [Message] Model add created_at (diff)
downloadserver-f456a9b1f3175c298644be276be01f79027e9d5d.tar.xz
:bug: convert string to bigint Permissions
Diffstat (limited to 'src/util/Permissions.ts')
-rw-r--r--src/util/Permissions.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/Permissions.ts b/src/util/Permissions.ts

index 588d7bb9..4627143a 100644 --- a/src/util/Permissions.ts +++ b/src/util/Permissions.ts
@@ -124,7 +124,7 @@ export class Permissions extends BitField { // * permission: current calculated permission (e.g. 010) // * deny contains all denied permissions (e.g. 011) // * allow contains all explicitly allowed permisions (e.g. 100) - return (permission & ~overwrite.deny) | overwrite.allow; + return (permission & ~BigInt(overwrite.deny)) | BigInt(overwrite.allow); // ~ operator inverts deny (e.g. 011 -> 100) // & operator only allows 1 for both ~deny and permission (e.g. 010 & 100 -> 000) // | operators adds both together (e.g. 000 + 100 -> 100) @@ -133,7 +133,7 @@ export class Permissions extends BitField { static rolePermission(roles: Role[]) { // adds all permissions of all roles together (Bit OR) - return roles.reduce((permission, role) => permission | role.permissions, 0n); + return roles.reduce((permission, role) => permission | BigInt(role.permissions), 0n); } static finalPermission({