diff options
author | Erkin Alp Güney <erkinalp9035@gmail.com> | 2022-04-08 10:26:20 +0300 |
---|---|---|
committer | Erkin Alp Güney <erkinalp9035@gmail.com> | 2022-04-08 10:26:20 +0300 |
commit | ec07a9f415eb34eac2249c9fdaf0769f880717d1 (patch) | |
tree | 8c7826eca378f0fcd020a901c98890b822526b8d /util | |
parent | Update index.ts (diff) | |
download | server-ec07a9f415eb34eac2249c9fdaf0769f880717d1.tar.xz |
fix the build mistakes from yesternight
Diffstat (limited to 'util')
-rw-r--r-- | util/src/util/Rights.ts | 17 |
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); +} |