mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 11:37:08 +00:00
Adapt version.get middleware to new permissions approach
This commit is contained in:
@@ -5,7 +5,7 @@ module.exports = async function (req, res, next) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const v = await version();
|
const v = await version();
|
||||||
if (req.user?.role != "admin" && req.user?.role != "user") {
|
if (!["write", "edit"].some( op => req.user?.operations.includes(op) )) {
|
||||||
delete v.os;
|
delete v.os;
|
||||||
delete v.db;
|
delete v.db;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user