Dentolize · Expense & Salary Date Permissions Walkthrough
On this pageBusiness viewTechnical view

Granting the permission

Business view

Permissions in Dentolize are managed per group (Settings → Permission Groups), not per individual user — a user's access comes from the group they belong to. Each row in a group's permission table is a feature area (Expenses, Salary Hub, Users, and so on), with checkboxes for View, Add, Edit, Delete, and now, for a couple of rows, Change Creation Date.

That new checkbox only shows up for rows where it makes sense — right now that's Expenses and Salary Hub. It's also not a free-standing permission: a group must already be able to Add the record type before it can be trusted to also move its date. Check "Add New" first, then "Change Creation Date" becomes available; uncheck "Add New" and the date permission is cleared with it.

To turn this on for a role — say, an HR manager who should be able to back-date a bonus or correct a mis-dated expense — open their permission group, go to the Settings tab, and check the box in the new column for Expenses and/or Salary Hub, then Save.

Technical view

The column is defined once in the shared table-column config used for the Settings tab of the group editor, and applies to any row flagged hasCreatedAt: true:

  • /work/repo/packages/clinic-web/src/components/dashboard/settings/Groups/tableData.js:89

EXPENSES row gets hasCreatedAt: true

  • /work/repo/packages/clinic-web/src/components/dashboard/settings/Groups/tableData.js:118

SALARY_ADJUSTMENT row gets hasCreatedAt: true

  • /work/repo/packages/clinic-web/src/components/dashboard/settings/Groups/tableData.js:1111-1211

— new tableColumns entry (index 13) that renders the checkbox only when el.hasCreatedAt is true, named ${el.key}_CREATED_AT (i.e. EXPENSES_CREATED_AT / SALARY_ADJUSTMENT_CREATED_AT), and disables it unless ADD_${el.key} is already checked (or the box is already checked, so it can still be unchecked)

  • /work/repo/packages/clinic-web/src/components/dashboard/settings/Groups/Group.js:235

— the Settings tab of the group editor now uses this new column set (columns[13]) instead of the generic columns[0] set it used before, so only the Settings tab (which owns the Expenses/Salary Hub rows) shows the extra column

The permission values themselves live in the shared Permission enum, added in both the Prisma schema and the GraphQL enum so client and server agree on the same string values:

  • /work/repo/packages/prisma/schema.prisma:6160-6171
  • /work/repo/packages/server/src/enums.graphql:412-423
  • /work/repo/packages/prisma/migrations/20260902160000_add_created_at_permissions/migration.sql

ALTER TYPE "Permission" ADD VALUE 'EXPENSES_CREATED_AT' / 'SALARY_ADJUSTMENT_CREATED_AT'

A user's effective permission is request.session.user.group.permissions containing the permission string, or the group having the catch-all DO_ALL permission (owners). Both server-side date helpers (getPermittedDate, getCreatedAt) check it this way — see Expenses and Salary adjustments for where each is used.