(req: Request, _res: Response, next: NextFunction)
| 7 | * Require the request to have been made by an admin |
| 8 | */ |
| 9 | export const handler = async (req: Request, _res: Response, next: NextFunction) => { |
| 10 | if (!isAdmin(req.accountability)) { |
| 11 | throw new ForbiddenError(); |
| 12 | } |
| 13 | |
| 14 | return next(); |
| 15 | }; |
| 16 | |
| 17 | export default asyncHandler(handler); |