mirror of
https://github.com/mollersuite/monofile.git
synced 2024-11-21 13:36:25 -08:00
token-permissions: update fileApiRoutes
This commit is contained in:
parent
2006fa1cca
commit
6742bf724f
|
@ -7,7 +7,7 @@ import {writeFile} from "fs";
|
|||
|
||||
import ServeError from "../lib/errors";
|
||||
import Files from "../lib/files";
|
||||
import { getAccount, requiresAccount } from "../lib/middleware";
|
||||
import { getAccount, requiresAccount, requiresPermissions } from "../lib/middleware";
|
||||
|
||||
let parser = bodyParser.json({
|
||||
type: ["text/plain","application/json"]
|
||||
|
@ -24,7 +24,7 @@ let config = require(`${process.cwd()}/config.json`)
|
|||
|
||||
fileApiRoutes.use(getAccount);
|
||||
|
||||
fileApiRoutes.get("/list", requiresAccount, (req,res) => {
|
||||
fileApiRoutes.get("/list", requiresAccount, requiresPermissions("user"), (req,res) => {
|
||||
|
||||
let acc = res.locals.acc as Accounts.Account
|
||||
|
||||
|
@ -44,7 +44,7 @@ fileApiRoutes.get("/list", requiresAccount, (req,res) => {
|
|||
|
||||
})
|
||||
|
||||
fileApiRoutes.post("/manage", parser, (req,res) => {
|
||||
fileApiRoutes.post("/manage", parser, requiresPermissions("manage"), (req,res) => {
|
||||
|
||||
let acc = res.locals.acc as Accounts.Account
|
||||
|
||||
|
|
Loading…
Reference in a new issue