Skip to content

Commit 7aaa4b3

Browse files
add flex role to export endpoint
1 parent e1dcd5d commit 7aaa4b3

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

server/endpoints/system.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -389,15 +389,19 @@ function systemEndpoints(app) {
389389
}
390390
});
391391

392-
app.get("/system/data-export", [validatedRequest], async (_, response) => {
393-
try {
394-
const { filename, error } = await exportData();
395-
response.status(200).json({ filename, error });
396-
} catch (e) {
397-
console.log(e.message, e);
398-
response.sendStatus(500).end();
392+
app.get(
393+
"/system/data-export",
394+
[validatedRequest, flexUserRoleValid],
395+
async (_, response) => {
396+
try {
397+
const { filename, error } = await exportData();
398+
response.status(200).json({ filename, error });
399+
} catch (e) {
400+
console.log(e.message, e);
401+
response.sendStatus(500).end();
402+
}
399403
}
400-
});
404+
);
401405

402406
app.get("/system/data-exports/:filename", (request, response) => {
403407
const exportLocation = __dirname + "/../storage/exports/";

0 commit comments

Comments
 (0)