Lattice Grid Buy a licence

developer guide

Column Permissions in a JavaScript Data Grid

A column can be readable, write-only, or out of reach entirely, decided against whatever user context your application already has, and export honours the same rule so a restricted column does not leave in a spreadsheet.

Developer guideCollaboration and comments › Column Permissions in a JavaScript Data Grid

Column permissions

Four levels, resolved per column from configuration or a callback. They are not a ladder, reading and writing are independent, so they are the four corners of a 2×2.

LevelVisibleReadableEditableFor
hidden, , , Absent from the grid, the tool panel, exports, the clipboard, saved state and the filter model.
readyesyes, No editor opens; paste, fill and clear skip it.
writeOnlyyes, yesA secret. The cell shows a mask, the editor opens empty.
writeyesyesyesThe default, so the feature is opt-in.

Every accepted form

permissions: 'read'                                   // blanket
permissions: { salary: 'read', ssn: 'hidden' }        // '*' sets the default
permissions: (column, ctx) =>
  ctx.context.role === 'admin' ? 'write' : 'read'

permissions: {
  default: 'read',
  columns: { name: 'write' },
  resolve: (column, ctx) => ctx.context.role === 'admin' ? 'write' : undefined,
}

grid.permissions.setContext({ role: 'clerk' });        // re-resolves everything

For three of the four this is a usability control, not a security boundary. Anything the grid can render it has already loaded, and devtools reaches it. Hiding a column removes it from the interface, not from the process, which is worth a great deal for the way data actually leaks, which is an export mailed onward or a shared view carrying a column a colleague should not see.

writeOnly is the exception, and the reason it exists. Nothing in the grid needs the value, so your server can send null for that field and the column still works: at which point the secret is genuinely not on the page. Enforce everything else server-side; permittedColumns and permittedExport are pure and dependency-free so the same policy object runs in Node against a request that arrived over the wire.