fleet/website/api/controllers/query-generator/view-query-generator.js
Eric 0e72c5daeb
Website: Move query generator out of Admin section (#25301)
Changes:
- Updated the User model to have a new attribute: `canUseQueryGenerator`
a boolean attribute that will grant users access to the query generator
page on the website.
- Added a new policy: `has-query-generate-access`
- Moved the query generator page from the admin section of the website.

Note: before this change can be merged, the website's database will need
to be migrated to add the new column to the User table
2025-01-14 18:09:17 -06:00

29 lines
515 B
JavaScript
Vendored

module.exports = {
friendlyName: 'View query generator',
description: 'Display "Query generator" page.',
exits: {
success: {
viewTemplatePath: 'pages/admin/query-generator'
},
badConfig: { responseType: 'badConfig' },
},
fn: async function () {
if (!_.isObject(sails.config.builtStaticContent) || !_.isArray(sails.config.builtStaticContent.schemaTables)) {
throw {badConfig: 'builtStaticContent.schemaTables'};
}
// Respond with view.
return {};
}
};