fleet/ee/vulnerability-dashboard/api/helpers/redact-user.js
Eric b1945b2128
Add fleet-vulnerability-dashboard repo to ee/ folder (#17428)
Closes: https://github.com/fleetdm/confidential/issues/4057

Changes:
- Added the contents of the fleet-vulnerability-dashboard repo to
ee/vulnerability-dashboard
- Added a github workflow to deploy the vulnerability dashboard on
Heroku
- Added a github workflow to test changes to the vulnerability-dashboard
- Updated the website's custom configuration to enable
auto-approvals/review requests to files in the
ee/vulnerability-dashboard folder
2024-03-13 13:06:11 -05:00

33 lines
456 B
JavaScript

module.exports = {
friendlyName: 'Redact user',
description: 'Destructively remove properties from the provided User record to prepare it for publication.',
sync: true,
inputs: {
user: {
type: 'ref',
readOnly: false
}
},
fn: function ({ user }) {
for (let [attrName, attrDef] of Object.entries(User.attributes)) {
if (attrDef.protect) {
delete user[attrName];
}//fi
}//∞
}
};