const fs = require('fs');
let content = fs.readFileSync('frontend/src/menuAside.ts', 'utf8');

const itemsToUpdate = [
  'READ_PAYROLL_RUNS',
  'READ_PAYROLL_LINE_ITEMS',
];

itemsToUpdate.forEach(perm => {
  content = content.replace(new RegExp(`permissions: '${perm}'`, 'g'), `permissions: '${perm.replace('READ_', 'UPDATE_')}'`);
});

fs.writeFileSync('frontend/src/menuAside.ts', content);
console.log("Patched payroll in menuAside.ts");
