# Roles, permission sets and restrictions

> Give people access with roles made of permission sets, and fence it off with restrictions.

Source: https://docs.ligament.ai/guides/access/roles-and-permission-sets/

Use this page when you set up who can do what in a workspace: you’ll make a role, give it permission sets, and add restrictions where something must never happen. Everything here lives in **Settings › Access**, under the Roles, Permission sets and Restrictions tabs. You need to be a workspace owner or admin, or an [app admin](https://docs.ligament.ai/guides/access/app-admins/index.md) for one app’s roles, sets and restrictions.

## Roles

A role is what you give a person. Every member has one **seat role**, chosen in Settings › Members, and can hold more roles on top of it (see [Who holds a role](https://docs.ligament.ai/guides/access/index.md#who-holds-a-role)).

### Built-in roles

| Role | What it gets |
| --- | --- |
| Owner | Everything, including owner-only settings such as granting build permissions, adding `workspace.admin` to a set, and break-glass settings. Owner and admin skip grants and see every row; the Roles list shows them as **Bypasses rules**. |
| Admin | Everything an owner can do on records, plus Settings, Build, AI, Logs and the App Store. Only an owner can make someone an owner. |
| Member | The permission sets the installed apps ship for members, such as `itsm.member` and `people.member`. In Northwind Group the member role holds 14 sets, 13 of them shipped by apps. |
| Viewer | The sets apps ship for viewers, such as `itsm.viewer`. Mostly read access. |

You can’t rename or delete the built-in roles. You change what member and viewer allow by adding sets to them or by adding restrictions.

### Custom roles

Click **New role** on the Roles tab. A custom role has:

| Setting | What it does |
| --- | --- |
| Name, key, description | The key (for example `team_lead`) can’t change later. Reserved keys such as `system`, `enduser`, `public` and `everyone` are refused. |
| Permission sets | The sets the role holds. You can add workspace sets and sets that apps ship (such as `itsm.member`) to build a role out of existing pieces. |
| Parameters | Default values for `@role.<name>` in the sets’ conditions. See [Role parameters](#role-parameters). |
| Elevatable, Break-glass, Max hours | Whether members can request the role for a few hours, or activate it themselves in an emergency. See [Time-bound and elevated access](https://docs.ligament.ai/guides/access/time-bound-access/index.md). |
| Overrides restrictions | Holders aren’t stopped by restrictions that are enforced on owners and admins. Owners only. |
| Build permissions | Which kinds of change the holders may apply in Build (pages, forms, data model, flows, access, code). Owners only. |

A custom role can be someone’s seat role, or be assigned on top of a seat. In Northwind Group, Max Maker’s seat role is the custom role `maker`; Vic Viewer’s seat is viewer and Vic also holds the custom role Team lead.

\[Screenshot: Settings › Access › Roles › Team lead: the role holds the My team permission set, and Vic Viewer holds it through a direct assignment with no expiry\]

A role page lists its sets, its parameters, its settings and **Who holds it**. Click **Assign role** to give it to a member or a group.

## Permission sets

A permission set says what its holders may do. Click **New set** on the Permission sets tab, or open a set and click **Edit**. The editor has four parts:

| Part | What you set |
| --- | --- |
| General | Label, key and description. |
| Grants | One or more grants. A grant is an entity, the operations (read, create, update, delete, transition), the record actions it allows, optionally a row condition, and optionally field levels for the rows it covers. No condition means every row. |
| Field levels | Per entity and field: hidden, masked, read or write, and whether holders may see the field’s past values (**Hide history**). Unlisted fields follow the grant: read for a set that only reads, write for one that updates or creates, masked for a [classified field](https://docs.ligament.ai/guides/access/data-classification/index.md). |
| Capabilities | Abilities that aren’t about records, such as opening Build or revealing masked values. See [Who can open Build, AI, Admin, Logs and the App Store](#who-can-open-build-ai-admin-logs-and-the-app-store) and [Capabilities for one app, and your own](#capabilities-for-one-app-and-your-own). |

\[Screenshot: The permission set editor for My team while it is being edited: Comment is ticked under Record actions, and on the rows of the grant Email is set to Masked\]

The panel on the right says the set in words (“read, update, comment on Person: Record is below me in my reporting line; there email masked”) and shows whether it’s valid. Click **Plan** to see who would gain or lose access before you click **Apply** (see [Reviewing access changes](https://docs.ligament.ai/guides/access/reviewing-access-changes/index.md)). The **JSON** tab shows the same set as a document:

```json
{
  "key": "people.my_team",
  "label": "My team",
  "description": "Update the people who report to me, at any level.",
  "origin": "workspace",
  "grants": [
    {
      "entity": "person",
      "ops": ["read", "update"],
      "where": { "all": [{ "left": "{{id}}", "op": "in", "right": "@me.descendants" }] }
    }
  ],
  "fields": { "person": { "user": "read", "manager": "read" } },
  "capabilities": []
}
```

Here a team lead can update the people below them in the reporting line, but can’t change who they report to or which login account the person record belongs to.

### Field levels

| Level | Holders |
| --- | --- |
| Write | see and change the field |
| Read | see it, not change it |
| Masked | see the shape of the value, not the value: `h•••@northwind.example` for an email, `••••1234` for a longer text, `•••••` for numbers, dates and references. They can’t change it, its past values aren’t shown, a filter on it matches nothing, and sorting, grouping and search leave it out. |
| Hidden | not see it at all |

**Hide history** keeps a field’s past values out of the record’s history, the audit trail and as-of reads for the set’s holders, while they still read today’s value.

When someone holds several sets, history combines like field levels: the most permissive wins. A set that hides a field’s history hides it only where no other set they hold reads that field without hiding it. History is decided for each record: on a record where another of their grants reads the field (a manager’s grant on the people below them, say), its past values show; on other records they don’t.

### Field levels on a grant

A grant can carry its own field levels. They apply only to the rows that grant covers, and win over the set’s field levels for those rows. When a person is covered by several grants on a row, they get the highest level any of them gives on that row.

This is how one set says “my own salary in clear, my reports’ salaries masked”:

```json
{
  "key": "hr.line_manager",
  "grants": [
    { "entity": "person", "ops": ["read"], "where": { "left": "{{user}}", "op": "eq", "right": "@me" }, "fields": { "salary": "read" } },
    { "entity": "person", "ops": ["read"], "where": { "left": "{{id}}", "op": "in", "right": "@me.descendants" }, "fields": { "salary": "masked" } }
  ]
}
```

The [HR example](https://docs.ligament.ai/guides/access/hr-example/index.md) builds a whole HR setup this way.

### Record actions

Besides the operations, a grant can allow record actions on its rows:

| Action | Allows |
| --- | --- |
| `comment` | public comments |
| `work_note` | internal work notes |
| `attach` | adding attachments |
| `export` | exporting records (CSV) |
| `merge` | merging duplicates |
| `bulk_update` | changing many records at once |
| `approval:decide` | deciding approvals on the record |
| `reveal` | revealing masked values (holders also need `pii.reveal`, see [Reveal a masked value](https://docs.ligament.ai/guides/access/data-classification/index.md#reveal-a-masked-value)) |

An action that no set in the workspace grants on an entity keeps its usual rule: comments, work notes and reveal follow read access; attach, merge and bulk update follow update; export stays with owners and admins, and an approval with its approvers. As soon as one set grants the action on the entity, only people whose grants include it may use it there. Owners and admins always may, unless a restriction enforced on them forbids it.

Attachments follow the record they’re on. Someone who can’t read a record can’t list, download, add or remove its files either: they get the same 404 as for the record. Adding or removing a file is checked on that record too, with the `attach` grants when a set grants `attach` on the entity, and otherwise with the person’s update access to that record.

For example, after the set `hr.reveal_personal_data` in Northwind Group granted `export` on person, Alex Agent’s export of people had Hannah Becker’s email masked as `h•••@northwind.example`: an export never contains more than the person can read.

### How sets combine

Sets add up. When a person holds several roles, they get every row any of their grants allows, and each field gets the highest level any set gives it. In Northwind Group, Mia Member holds `people.member` (every field writable) and, through a delegation, `people.my_team` (manager read only): Mia can still change the manager field, because write is the higher level.

To take something away, use a restriction.

### Sets that apps ship

When you install an app it adds a set for each role its rules mention, named after the app and the role: `itsm.member`, `itsm.viewer`, `csm.enduser`. The Permission sets tab marks them as shipped by the app, and the Roles list counts them (“14 (13 shipped)”). Add a shipped set to a custom role to give that role the same access to the app as the built-in role has.

### Role parameters

A grant can compare a field with `@role.<name>`, so one set serves several roles. For example, a set with the grant “read person where `location` eq `@role.location`” and two roles that hold it, one with the parameter `location` = `Bangkok` and one with `Berlin`.

-   The role gives the default value. An assignment or a group mapping can give its own value, which wins.
-   `*` means any value: the condition is dropped.
-   A missing or empty value matches nothing, so a forgotten parameter never opens every row.

## Restrictions

A restriction forbids something for everyone it covers, whatever their roles grant. Use one for rules that must hold, such as “nobody deletes a person who has a login account” or “viewers never see phone numbers”. Click **New restriction** on the Restrictions tab.

| Setting | What it does |
| --- | --- |
| Entity | The entity it applies to. |
| Forbidden actions | What it forbids: operations (read, create, update, delete, transition), record actions such as `approval:decide` or `export`, and moving a record into a state (`transition:<state>`, or `transition:*` for any named transition). |
| Forbidden when | A row condition. Empty means always. |
| Field caps | The most a field may be: hidden, masked or read. They apply on every row, or on every row except those matching **Except on rows where**. They can’t be combined with **Forbidden when**. |
| Except on rows where | Optional, with field caps only. A row condition (the same conditions as a grant’s) for rows the caps don’t apply to: the person’s own record (`{{user}} = @me`), a request they filed (`{{requested_by}} = @me`), their direct reports (`{{id}} in @me.descendants via <hierarchy>` with `depth: { max: 1 }`). The level is worked out per row, as for grants. |
| Reveal | With a masked cap only. Off (the default): a value the restriction masks can’t be revealed. On (`revealable`): people with the `pii.reveal` capability can reveal it with a reason, which goes into the access audit. |
| Roles | Who it covers. Empty means everyone. |
| Enforce on owners and admins too | Off by default: owners and admins aren’t covered. Switch it on for rules such as separation of duties. Holders of a role with **Overrides restrictions** are still exempt. |
| Except holders of capability | Optional. People whose sets hold this capability aren’t covered, for example `hr.medical` for “leave reasons are hidden, except for HR”. |
| Message | What a refused person reads, in the error and in the Why panel. |

Restrictions are how you set up [separation of duties](https://docs.ligament.ai/guides/access/separation-of-duties/index.md).

Northwind Group has this one:

```json
{
  "key": "people.no_phone_for_viewers",
  "entity": "person",
  "actions": [],
  "fields": { "phone": "hidden" },
  "roles": ["viewer"],
  "enforceOnAdmins": false,
  "message": "Viewers don't see personal phone numbers."
}
```

Vic Viewer also holds Team lead, whose set gives write on unlisted person fields. The restriction still wins: for Vic, `phone` is hidden on every person.

A restriction with a condition and **Enforce on owners and admins too** on covers owners as well. With this restriction applied, `forbidWhen` `{{user}} not_empty` and `actions: ["delete"]`, explaining a delete for Ada (the owner) gave:

```text
allow: false   reason: forbidden
message: People with a login account are offboarded, not deleted.
"owner" (workspace admin): every row, except where a restriction enforced on admins forbids
restriction people.keep_leavers (enforced on admins): forbids delete where user not_empty
restriction people.keep_leavers matches this record: user is set
```

The same check on a person without a login account was allowed.

### A rule that depends on the record

“Salary is for HR, the employee and the managers above them, owners and admins included” is one restriction:

```json
{
  "key": "hr.pay_hr_only",
  "entity": "hr_employee",
  "fields": { "salary": "masked" },
  "unlessCapability": "hr.comp",
  "unlessWhere": { "any": [
    { "left": "{{user}}", "op": "eq", "right": "@me" },
    { "left": "{{id}}", "op": "in", "right": "@me.descendants", "via": "hr.reporting" }
  ] },
  "revealable": true,
  "enforceOnAdmins": true,
  "message": "Pay is for HR, the employee and the managers above them."
}
```

For an owner, the salary is in clear on their own record and on the records of everyone below them in the reporting line, and masked on every other record: in lists, search, exports, the API and the history. A filter or sort on salary matches nothing for them while any row they see is masked, because it would tell them something about the masked rows. A total on salary is shown only over rows that are all in clear for them (their own line), and left out whenever a masked row is part of it. Holders of `hr.comp` aren’t covered at all. The relation is a parameter: `in @me.descendants` is everyone below (the chain); add `"depth": { "max": 1 }` for direct reports only. The reporting line is read from a table of who is below whom that’s kept up to date on every change, so the check costs no recursive query, and a loop in the line can’t be saved. See the [HR example](https://docs.ligament.ai/guides/access/hr-example/index.md) for the full model.

Apps can ship restrictions too. ITSM ships one that hides `resolution_notes` on incidents from members; it shows on the Restrictions tab with the app as its origin.

## Who can open Build, AI, Admin, Logs and the App Store

Parts of the app that change the workspace itself need a **capability**. A permission set grants capabilities, and a person has a capability when any set they hold grants it.

| Capability | Opens |
| --- | --- |
| `workspace.admin` | Members, access, workspace settings, secrets and embed tokens. Includes every capability below. Only owners can add it to a set. |
| `build:use` | Build: data model, pages, components, blocks, changes, apps, imports, automations, plugins, extensions and templates. |
| `ai:manage` | AI: agents, knowledge sources, MCP servers, tunnels, prompts and AI governance. |
| `store:install` | The App Store: install, upgrade and remove apps, modules and plugins. |
| `logs:read` | Logs: workflow runs, API calls, audit, agent and assistant activity, outbound mail and spend. |
| `access.explain.others` | Explain another person’s access and use [View as](https://docs.ligament.ai/guides/access/view-as/index.md). |
| `access.delegate` | Create [delegations](https://docs.ligament.ai/guides/access/time-bound-access/index.md#delegations) for other people’s reporting lines. |
| `pii.reveal` | [Reveal masked values](https://docs.ligament.ai/guides/access/data-classification/index.md#reveal-a-masked-value) on a record, with a reason. |

Connecting an outside account is an admin action, even inside Build and the App Store: entering or changing a plugin’s token, secret, headers or base URL, choosing which secret and hosts a connector uses, testing a provider such as an email sender, making one the default and removing it all need an owner or admin (an API key also needs `settings:write`). Builders keep authoring the connectors themselves; a secret a connector was connected with is sent only by that connector, only to its hosts, and can’t be used as `{{secrets.NAME}}` in a flow or script. Each of these changes is recorded in the access audit.

Owners and admins hold every capability. Members and viewers hold none by default, so their app shows their own work and their personal settings (profile, security, notifications and API keys). A page they can’t open says so: “If you need it, ask a workspace admin.”

### Example: a maker role

Northwind Group has a custom role `maker` that holds a set `maker_tools` with the capability `build:use` and no grants. Max Maker, whose seat role is `maker`, can open Build but not Logs, the App Store or AI settings. To give a member Build without making them an admin:

1.  On the Permission sets tab, click **New set**. Name it, leave Grants empty, and under Capabilities tick `build:use`.
2.  Click **Plan**, then **Apply**.
3.  On the Roles tab, click **New role**, add the set, and apply.
4.  Give the role to the person: as their seat role in Settings › Members, or with **Assign role** on the role page.

In the same way, Northwind’s `service_desk.lead` set grants `logs:read` along with delete on incidents, so shift leads can read the logs.

### Capabilities for one app, and your own

Some capabilities can be given for one app only, written `<capability>@<app>`:

-   `app.admin@<app>` makes the holder an administrator of that app, for example `app.admin@itsm`. Today it lets them change the classification of that app’s fields through the API (`PUT /api/access/classification`); the Classification page itself is for workspace admins.
-   `pii.reveal@<app>` lets the holder reveal masked values on that app’s records only.

You can also name your own capabilities, `<prefix>.<name>`, such as `hr.medical`. They don’t open anything by themselves: restrictions use them as an exemption (“hidden, except for holders of `hr.medical`”). Names starting with a prefix the platform uses (`workspace.`, `access.`, `pii.`, `app.`, `records.` and a few others) are refused.

In the editor, the Capabilities part lists the workspace capabilities, the per-app ones for each installed app, and the capabilities your other sets already use; type any other one under **Add a capability**. The editor checks the name as you add it.

## Do it through the API

Roles, permission sets and restrictions are documents you can read, plan and apply through the spec API and MCP (addresses `role/<key>`, `permissionSet/<key>`, `restriction/<key>`). Changes made with an API key wait for a person to apply them; see [Reviewing access changes](https://docs.ligament.ai/guides/access/reviewing-access-changes/index.md#changes-made-with-an-api-key). Endpoints: [Access](https://docs.ligament.ai/reference/rest-api/index.md#access) and [Spec store](https://docs.ligament.ai/reference/rest-api/index.md#spec-store).
