Skip to content
BENIBIX Learn

Column-Level Security

Also known as Column-Level Access Control, Column Permissions, Column Privileges

People may read a table but not all its columns. The private columns stay closed.

Think of it like

It is like a letter with some lines covered by tape. You can read the rest, but not those lines.

Example

A shop lets its support role read the name and total columns, but not email. A query that asks for email fails with an error.

Why it matters

Most tables mix plain fields and private ones. This shares the plain fields without making a cut-down copy.

Definition

Column-level security lets people read a table but not every column in it. A rule says which roles may see which columns. A support agent may see a name and an order, but not a card number. Asking for a blocked column gives an error, not the data. This keeps one table useful for many teams. The private columns stay closed.

Example code

sql
GRANT SELECT (name, total) ON customers TO support;
The support role may read two columns of the table. Every other column stays closed.
The grey email column is closed to Lucy. The rest of the table stays open.

Common mistake

Thinking a closed column is the same as a masked one. A closed column fails the query. A masked one returns stars.

Key takeaways

  1. 1
    Per column. Rights are set field by field.
  2. 2
    Set by role. Roles decide which fields show.
  3. 3
    Refused, not blank. A closed column gives an error.

Compare