Revert "feat: open administration to all users"
This reverts commit b4b21fb21b.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const express = require('express');
|
||||
const { verifyToken } = require('../auth');
|
||||
const { verifySuperAdmin } = require('../auth');
|
||||
const {
|
||||
completeAuthorization,
|
||||
createAuthorizationUrl,
|
||||
@@ -13,7 +13,7 @@ const { exportMissingProductionOrderDataCsv, importFinalizedProductionOrderCsv,
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.get('/olist/status', verifyToken, async (req, res, next) => {
|
||||
router.get('/olist/status', verifySuperAdmin, async (req, res, next) => {
|
||||
try {
|
||||
res.json(await getOlistStatus({
|
||||
runsPage: req.query.runsPage,
|
||||
@@ -24,7 +24,7 @@ router.get('/olist/status', verifyToken, async (req, res, next) => {
|
||||
}
|
||||
});
|
||||
|
||||
router.post('/olist/authorization-url', verifyToken, async (req, res, next) => {
|
||||
router.post('/olist/authorization-url', verifySuperAdmin, async (req, res, next) => {
|
||||
try {
|
||||
res.json({ url: await createAuthorizationUrl() });
|
||||
} catch (error) {
|
||||
@@ -32,7 +32,7 @@ router.post('/olist/authorization-url', verifyToken, async (req, res, next) => {
|
||||
}
|
||||
});
|
||||
|
||||
router.post('/olist/sync', verifyToken, async (req, res, next) => {
|
||||
router.post('/olist/sync', verifySuperAdmin, async (req, res, next) => {
|
||||
try {
|
||||
const result = await startOlistSync({
|
||||
trigger: 'manual',
|
||||
@@ -44,7 +44,7 @@ router.post('/olist/sync', verifyToken, async (req, res, next) => {
|
||||
}
|
||||
});
|
||||
|
||||
router.post('/olist/sync/stop', verifyToken, async (req, res, next) => {
|
||||
router.post('/olist/sync/stop', verifySuperAdmin, async (req, res, next) => {
|
||||
try {
|
||||
res.status(202).json(await requestOlistSyncStop());
|
||||
} catch (error) {
|
||||
@@ -52,7 +52,7 @@ router.post('/olist/sync/stop', verifyToken, async (req, res, next) => {
|
||||
}
|
||||
});
|
||||
|
||||
router.get('/olist/production-order-imports', verifyToken, async (req, res, next) => {
|
||||
router.get('/olist/production-order-imports', verifySuperAdmin, async (req, res, next) => {
|
||||
try {
|
||||
res.json(await listProductionOrderImportData({
|
||||
runsPage: req.query.runsPage,
|
||||
@@ -63,7 +63,7 @@ router.get('/olist/production-order-imports', verifyToken, async (req, res, next
|
||||
}
|
||||
});
|
||||
|
||||
router.get('/olist/production-order-imports/pending-csv', verifyToken, async (req, res, next) => {
|
||||
router.get('/olist/production-order-imports/pending-csv', verifySuperAdmin, async (req, res, next) => {
|
||||
try {
|
||||
res.json(await exportMissingProductionOrderDataCsv());
|
||||
} catch (error) {
|
||||
@@ -71,7 +71,7 @@ router.get('/olist/production-order-imports/pending-csv', verifyToken, async (re
|
||||
}
|
||||
});
|
||||
|
||||
router.post('/olist/production-order-imports', verifyToken, async (req, res, next) => {
|
||||
router.post('/olist/production-order-imports', verifySuperAdmin, async (req, res, next) => {
|
||||
try {
|
||||
res.status(201).json(await importFinalizedProductionOrderCsv(req.body || {}));
|
||||
} catch (error) {
|
||||
@@ -79,7 +79,7 @@ router.post('/olist/production-order-imports', verifyToken, async (req, res, nex
|
||||
}
|
||||
});
|
||||
|
||||
router.get('/olist/runs/:runId', verifyToken, async (req, res, next) => {
|
||||
router.get('/olist/runs/:runId', verifySuperAdmin, async (req, res, next) => {
|
||||
try {
|
||||
res.json(await getOlistRunDetails(req.params.runId, {
|
||||
eventsPage: req.query.eventsPage,
|
||||
|
||||
Reference in New Issue
Block a user