summary refs log tree commit diff
path: root/api/src/util/handlers/route.ts
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-04-19 20:09:22 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-04-19 20:09:22 +1000
commitb941560d484024d764521ab9ca42f4bb900b00be (patch)
treef130ec9ef94665f4e38056eb958a1b0709438efc /api/src/util/handlers/route.ts
parentfixed migration? (diff)
parentTry catch cpu log (diff)
downloadserver-b941560d484024d764521ab9ca42f4bb900b00be.tar.xz
Merge branch 'master' into slowcord
Diffstat (limited to 'api/src/util/handlers/route.ts')
-rw-r--r--api/src/util/handlers/route.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/api/src/util/handlers/route.ts b/api/src/util/handlers/route.ts

index 0048c4dd..3d3bbc37 100644 --- a/api/src/util/handlers/route.ts +++ b/api/src/util/handlers/route.ts
@@ -6,6 +6,7 @@ import { FieldErrors, FosscordApiErrors, getPermission, + getRights, PermissionResolvable, Permissions, RightResolvable, @@ -105,6 +106,8 @@ export function route(opts: RouteOptions) { if (opts.right) { const required = new Rights(opts.right); + req.rights = await getRights(req.user_id); + if (!req.rights || !req.rights.has(required)) { throw FosscordApiErrors.MISSING_RIGHTS.withParams(opts.right as string); }