Skip to content

Commit

Permalink
Enabled history get permission using cascade verification (#462)
Browse files Browse the repository at this point in the history
  • Loading branch information
petruki authored Nov 2, 2023
1 parent f2a5ec5 commit 53bf66d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/routers/config-strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ router.get('/configstrategy/history/:id', auth, [
const query = 'oldValue newValue updatedBy date -_id';
const history = await getHistory(query, configStrategy.domain, configStrategy._id, req.query);

await verifyOwnership(req.admin, configStrategy, configStrategy.domain, ActionTypes.READ, RouterTypes.STRATEGY);
await verifyOwnership(req.admin, configStrategy, configStrategy.domain, ActionTypes.READ, RouterTypes.STRATEGY, true);

res.send(history);
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion src/routers/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ router.get('/config/history/:id', auth, [
const query = 'oldValue newValue updatedBy date -_id';
const history = await getHistory(query, config.domain, config._id, req.query);

await verifyOwnership(req.admin, config, config.domain, ActionTypes.READ, RouterTypes.CONFIG);
await verifyOwnership(req.admin, config, config.domain, ActionTypes.READ, RouterTypes.CONFIG, true);

res.send(history);
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion src/routers/domain.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ router.get('/domain/history/:id', auth, [
const query = 'oldValue newValue updatedBy date -_id';
const history = await getHistory(query, domain._id, domain._id, req.query);

await verifyOwnership(req.admin, domain, domain._id, ActionTypes.READ, RouterTypes.DOMAIN);
await verifyOwnership(req.admin, domain, domain._id, ActionTypes.READ, RouterTypes.DOMAIN, true);

res.send(history);
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion src/routers/group-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ router.get('/groupconfig/history/:id', auth, [
const query = 'oldValue newValue updatedBy date -_id';
const history = await getHistory(query, groupconfig.domain, groupconfig._id, req.query);

await verifyOwnership(req.admin, groupconfig, groupconfig.domain, ActionTypes.READ, RouterTypes.GROUP);
await verifyOwnership(req.admin, groupconfig, groupconfig.domain, ActionTypes.READ, RouterTypes.GROUP, true);

res.send(history);
} catch (e) {
Expand Down

0 comments on commit 53bf66d

Please sign in to comment.