mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 10:07: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 {
|
||||
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.db;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user