mirror of
https://github.com/mollersuite/monofile.git
synced 2024-11-21 21:36:26 -08:00
token-permissions: update middleware further
This commit is contained in:
parent
a04cc9a376
commit
fad320d7fb
|
@ -32,8 +32,6 @@ export const requiresAdmin: RequestHandler = function(_req, res, next) {
|
|||
next()
|
||||
}
|
||||
|
||||
export namespace apiBlockers {
|
||||
|
||||
/**
|
||||
* @description Blocks requests based on the permissions which a token has. Does not apply to routes being accessed with a token of type `User`
|
||||
* @param tokenPermissions Permissions which your route requires.
|
||||
|
@ -72,5 +70,3 @@ export namespace apiBlockers {
|
|||
if (auth.getType(tokenFor(req)) == "App") ServeError(res, 403, "apps are not allowed to access this endpoint")
|
||||
else next()
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue