# App admins

> Let someone manage access for one app, without making them a workspace admin.

Source: https://docs.ligament.ai/guides/access/app-admins/

An app admin manages access for one app, and only that app. Give your customer success lead app admin rights for CSM and they can build CSM roles, hand them out, restrict CSM records and read the CSM part of the access audit. They can’t touch Service Desk, workspace settings, members’ seat roles, API keys, SSO or SCIM.

Workspace owners and admins keep everything they have today. App admin rights only ever add to what a member can do, inside one app.

## Make someone an app admin

App admin rights are a capability, `app.admin@<app>`, that a permission set carries. Give it to a person through a role, the same way as any other access:

1.  In **Settings › Access › Permission sets**, create a set (for example `csm.admins`) with the capability `app.admin@csm`. It needs no grants.
2.  Create a role (for example **CSM admin**) that holds the set.
3.  Assign the role to the person, or map it to a group.

Only a workspace owner or admin can do this the first time. After that, an app admin can make other people admins of the same app: they may grant `app.admin@csm` because they hold it.

`app.admin` always names an app. A set with a bare `app.admin` is refused.

One person can be an app admin of several apps: give them a set with `app.admin@csm` and `app.admin@crm`, or two roles. Everything below then applies to both apps together, so they can build one role from CSM and CRM sets.

## What belongs to an app

| Thing | Belongs to app X when |
| --- | --- |
| Entity | X installed it. An entity another app owns but X ships too (a shared entity, such as Customers’ `account` used by CSM) is shared with X. |
| Permission set | Its app is X, and every entity it names is X’s own or shared with X. A set an app ships, such as `csm.member`, belongs to that app. |
| Restriction | Its app is X and it is on one of X’s own entities. |
| Role | Every permission set it holds belongs to X. Seat roles (owner, admin, member, viewer) belong to the workspace. |

## What an app admin can do

-   **Permission sets.** Create and edit sets for their app: set **App** to their app and grant only that app’s entities. On a shared entity they can keep or narrow what a set already grants, but not widen it (no new operations, no dropped condition, no higher field level).
-   **Roles.** Create custom roles and give them their app’s sets. They can’t change seat roles, role permissions, break-glass, elevation or **Overrides restrictions**.
-   **Assignments.** Assign and remove a role when every set it holds belongs to their app. A role with no sets yet can’t be assigned.
-   **Restrictions.** Add restrictions on their app’s own entities. They can’t enforce a restriction on owners and admins.
-   **Audit.** Read the access audit rows about their app: its sets, roles and restrictions, assignments of its roles, and record reads and reveals on its entities.
-   **Why and effective access.** Ask why another member can or can’t do something on their app’s entities, see someone’s effective access on them, and see who can see one of their records.

Every change goes through the same plan and apply as a workspace admin’s, with the same history and audit row.

## What an app admin can’t do

-   Give `workspace.admin`, app admin rights for another app, or any capability they don’t hold themselves. Holding `pii.reveal` lets them give `pii.reveal@csm`; holding `pii.reveal@csm` doesn’t let them give `pii.reveal`.
-   Change another app’s sets, roles or restrictions, or grant access to another app’s entities.
-   Change groups, group mappings, hierarchies, shares, the evaluator, members’ seat roles, API keys, SSO, SCIM or any workspace setting.

When they try, the change is refused with HTTP 403 and code `app_admin`, and nothing is written. For example, a CSM admin who assigns a Service Desk role gets:

```json
{
  "error": "\"itsm_lead\" holds permission sets outside csm: only a workspace admin can assign it",
  "code": "app_admin"
}
```

## Where they work

An app admin’s nav has an **Admin** entry named after their app, for example **Access: Customer success** (plain **Access** when they administer several apps). It opens **Settings › Access** on the Roles tab. They see only the Roles, Permission sets, Restrictions, Entities, Assignments and Audit tabs, and each shows only their app’s rows. The other tabs (groups, hierarchies, classification, elevations, break-glass, delegations, shares and the overview) stay with workspace admins.

They create and edit their app’s permission sets, roles and restrictions in the same editors as a workspace admin: **New**, or **Edit** on one of their rows, then **Plan** and **Apply**. The plan shows who gains or loses access before anything changes. An editor for another app’s set, role or restriction answers “not found”. Saving a draft to a changeset in **Build › Changes** still needs the Build capability.

Through the API, they use the same endpoints as a workspace admin, with an API key or a signed-in session:

| Task | Request |
| --- | --- |
| Create or change a set | `PUT /api/access/permission-sets/<key>` with `app` set to their app |
| Create or change a role | `PUT /api/access/roles/<key>` with `name` and `permissionSets` |
| Assign a role | `POST /api/access/assignments` with `userId` and `roleKey` |
| Add a restriction | `PUT /api/access/restrictions/<key>` with `app` and `entity` |
| Read the audit | `GET /api/access/audit` |
| Lists | `GET /api/access/permission-sets`, `GET /api/access/restrictions`, `GET /api/access/assignments` (their app’s rows only) |
| Plan, apply or validate through the spec store | `POST /api/spec/plan`, `POST /api/spec/apply`, `POST /api/spec/validate` with items addressed `<app>/permissionSet/<key>`, `<app>/restriction/<key>` or `role/<key>` (roles have no app) |
| Read one of their artefacts or its history | `GET /api/spec/<app>/permissionSet/<key>` (add `?history=1` for the versions) |

The spec store routes accept an app admin only for their own app’s permission sets, roles and restrictions, or a new key. Any other item in the request (another app’s set, a page, a hierarchy) refuses the whole request with `403 capability_required`, before anything is planned. A new key that lands in another app is planned with the error `access.app_admin` and can’t be applied. People with the Build capability use these routes for every artefact type, as before.

An API key acts for the person who made it, so a CSM admin’s key has the same limits. The key also needs the endpoint’s scope (`settings:read` to read, `members:write` to change; `spec:read` to plan or read and `spec:apply` to apply through the spec store). Access changes made with a key wait for a person to apply them, as for workspace admins ([Reviewing access changes](https://docs.ligament.ai/guides/access/reviewing-access-changes/index.md)).

A CSM admin composing a role for case handlers:

```sh
curl -X PUT "https://app.ligament.ai/api/access/permission-sets/csm.triage" \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"app":"csm","grants":[{"entity":"case","ops":["read","update"]}]}'

curl -X PUT "https://app.ligament.ai/api/access/roles/csm_triage" \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"name":"Case triage","permissionSets":["csm.triage"]}'
```
