summary refs log tree commit diff
path: root/util/src
diff options
context:
space:
mode:
authorErkin Alp Güney <erkinalp9035@gmail.com>2022-04-08 10:26:20 +0300
committerErkin Alp Güney <erkinalp9035@gmail.com>2022-04-08 10:26:20 +0300
commit6482b112c427727d46efbb65b0f0ce78893e5049 (patch)
treee6455585d1ed309a1c78f354536f391217d450ca /util/src
parentUpdate index.ts (diff)
downloadserver-6482b112c427727d46efbb65b0f0ce78893e5049.tar.xz
fix the build mistakes from yesternight
Diffstat (limited to 'util/src')
-rw-r--r--util/src/util/Rights.ts17
1 files changed, 8 insertions, 9 deletions
diff --git a/util/src/util/Rights.ts b/util/src/util/Rights.ts

index dedbfe30..35ad9514 100644 --- a/util/src/util/Rights.ts +++ b/util/src/util/Rights.ts
@@ -87,15 +87,14 @@ export class Rights extends BitField { throw new HTTPError(`You are missing the following rights ${permission}`, 403); } - export async function getRight( - user_id: string, - /** opts: { - in_behalf?: (keyof User)[]; - } = {} **/) - { - user = await User.findOneOrFail({ where: { id: user_id } }); - return new Rights(user.right); - } } const ALL_RIGHTS = Object.values(Rights.FLAGS).reduce((total, val) => total | val, BigInt(0)); + +export async function getRights( user_id: string + /**, opts: { + in_behalf?: (keyof User)[]; + } = {} **/) { + let user = await User.findOneOrFail({ where: { id: user_id } }); + return new Rights(user.rights); +}