const PRIVILEGED_PAYROLL_ROLE_NAMES = new Set([
  'Administrator',
  'System Owner',
  'Payroll Manager',
  'Operations Manager',
]);

function isRestrictedPayrollUser(currentUser) {
  if (!currentUser?.id) {
    return false;
  }

  return !PRIVILEGED_PAYROLL_ROLE_NAMES.has(currentUser?.app_role?.name);
}

module.exports = {
  PRIVILEGED_PAYROLL_ROLE_NAMES,
  isRestrictedPayrollUser,
};
