token-permissions: update adminRoutes

This commit is contained in:
May 2023-10-02 19:20:32 -07:00
parent af9c3233d8
commit 8bec8a4360

View file

@ -5,7 +5,7 @@ import * as auth from "../lib/auth";
import bytes from "bytes" import bytes from "bytes"
import {writeFile} from "fs"; import {writeFile} from "fs";
import { sendMail } from "../lib/mail"; import { sendMail } from "../lib/mail";
import { getAccount, requiresAccount, requiresAdmin } from "../lib/middleware" import { getAccount, requiresAccount, requiresAdmin, requiresPermissions } from "../lib/middleware"
import ServeError from "../lib/errors"; import ServeError from "../lib/errors";
import Files from "../lib/files"; import Files from "../lib/files";
@ -19,6 +19,7 @@ adminRoutes
.use(getAccount) .use(getAccount)
.use(requiresAccount) .use(requiresAccount)
.use(requiresAdmin) .use(requiresAdmin)
.use(requiresPermissions("admin"))
let files:Files let files:Files
export function setFilesObj(newFiles:Files) { export function setFilesObj(newFiles:Files) {