# Admin: roles and data controls

Say who can do what, bring people in, and show what happens to the account's data.

For: Account owners and admins.

Web page: https://candor.themethodic.com/screens/admin-roles-and-data

## Layouts

### Members and roles

Pick it when: The default: who is in, and what each of them can do.

Layout: A members table with roles, pending invites below, and an invite button.

Items:

- **Members table** (`members-table`, Pro; https://candor.themethodic.com/docs/members-table.md): Members, their role on each environment, and invites still pending.
- **Invite members** (`invite-members`, Pro; https://candor.themethodic.com/docs/invite-members.md): Invite people by pasting any list of emails.
- **Access request** (`access-request`, Pro; https://candor.themethodic.com/docs/access-request.md): Ask for a role you don't have on an environment.

```bash
npx candor-ui add members-table invite-members access-request
```

### Role matrix

Pick it when: Deciding what each role may do before assigning anyone to it.

Layout: Roles across the top, actions down the side, each cell a dot where allowed.

Items:

- **Role matrix** (`role-matrix`, Pro; https://candor.themethodic.com/docs/role-matrix.md): What each role can do, as a matrix.
- **RACI chip** (`raci-chip`, Pro; https://candor.themethodic.com/docs/raci-chip.md): Who is responsible, accountable, consulted or informed.

```bash
npx candor-ui add role-matrix raci-chip
```

### Data controls page

Pick it when: People ask where their data is and how long it's kept.

Layout: Sections for region, retention and the account's data, each with its own action.

Items:

- **Data controls** (`data-controls`, Pro; https://candor.themethodic.com/docs/data-controls.md): How the data is used, an export, deleting thread history, deleting the account.
- **Data region** (`data-region`, Pro; https://candor.themethodic.com/docs/data-region.md): Where data lives and is processed, service by service.
- **Data retention** (`data-retention`, Pro; https://candor.themethodic.com/docs/data-retention.md): How long each kind of data is kept, and what happens after.
- **Type to confirm** (`type-to-confirm`, Pro; https://candor.themethodic.com/docs/type-to-confirm.md): Deleting is confirmed by typing a name.
- **SSO setup** (`sso-setup`, Pro; https://candor.themethodic.com/docs/sso-setup.md): Single sign-on through the identity provider.

```bash
npx candor-ui add data-controls data-region data-retention type-to-confirm sso-setup
```

## Rules that matter most here

- **A control that can't be used says why** (https://candor.themethodic.com/principles#locked-says-why): An action your role doesn't allow stays visible and says which role does.
- **Say what can and can't be undone** (https://candor.themethodic.com/principles#say-what-can-be-undone): Deleting the account or history states what is removed and that it can't be undone, and asks to type the name.
- **Unknown stays unknown** (https://candor.themethodic.com/principles#unknown-stays-unknown): A region or retention the service can't confirm says so, not a default.

A full-stack block builds this with an agent route and a store: `audit-data-controls` (https://candor.themethodic.com/docs/audit-data-controls.md). Each block has a `-claude` twin for the Claude Agent SDK.

## Brief for a coding agent

Paste this to the agent that builds the screen.

```text
Build admin screens with Candor UI for roles and data controls.
Members: MembersTable with role per environment and pending invites; InviteMembers takes any pasted list of emails; AccessRequest lets a person ask for a role.
Roles: RoleMatrix shows what each role can do; an action your role doesn't allow stays visible and says which role does.
Data: DataControls, DataRegion and DataRetention state facts from the service; if the service can't confirm one, show it as unknown, not as a default.
Deleting history or the account uses TypeToConfirm and says what is removed and that it can't be undone.
Add SsoSetup when the account signs in through an identity provider.
The audit-data-controls block has the routes and store for export and deletion.

Start from the "Members and roles" layout: A members table with roles, pending invites below, and an invite button.
Candor items: members-table (https://candor.themethodic.com/docs/members-table.md), invite-members (https://candor.themethodic.com/docs/invite-members.md), access-request (https://candor.themethodic.com/docs/access-request.md).
Install: npx candor-ui add members-table invite-members access-request
Read each item's docs before using it and take its props from there; don't guess them. Pro and Premium items need the person's licence key, which they add with `npx candor-ui key <key>`; don't ask for it.
```
