Skip to content

Commit

Permalink
Website: update has-query-generator-access policy (#25442)
Browse files Browse the repository at this point in the history
Changes:
- Updated the website's has-query-generator-access policy to allow super
admins to access the query generator page.
  • Loading branch information
eashaw authored Jan 15, 2025
1 parent 0e72c5d commit ae99e87
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions website/api/policies/has-query-generator-access.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ module.exports = async function (req, res, proceed) {
}
}//•

// Check if this user can access the query generator.
if (!req.me.canUseQueryGenerator) {
return res.forbidden();
// Then check that this user is a "super admin".
} else if (!req.me.canUseQueryGenerator && !req.me.isSuperAdmin) {
return res.forbidden();
// Check that this user is a "super admin".
if(!req.me.isSuperAdmin) {
// Then check if this user can access the query generator.
if (!req.me.canUseQueryGenerator) {
return res.forbidden();
}
}

// IWMIH, this user can access the query generator.
Expand Down

0 comments on commit ae99e87

Please sign in to comment.