**Roles** in your admin sidebar is where you decide what the people on your
team may open and change. A role is a set of permissions you pick screen by
screen, and whoever carries it gets exactly that. You give somebody a role on
**Team**, or here on the role itself.

You need the `view_roles` permission to open the screen and `manage_roles` to
make, change or delete a role and to change who carries it. Without
`manage_roles` you see the same screen with nothing to change.

## The list

The screen opens on the list alone, across its whole width, and shows no role
in full until you pick one. Each row shows the role's name and description,
how many permissions it holds or that it holds every one, whether it requires
two-factor and how many of its people lack it, when it last changed, and how
many people carry it. Your own role is marked.

Under the title the list counts your roles and the people on one. Two more
counts appear when they are not zero, and both are filters: the people who
lack the two-factor their role requires, and the roles nobody carries. Click
one to see only those roles, click it again to see them all.

The search box finds a role by name, description or `role_` id. The filter
menu narrows to roles with every permission or with chosen ones, to roles
that require two-factor, do not, or require it while somebody lacks it, and
to roles somebody carries or nobody does. Under **Allows** it narrows to the
roles that hold one permission you pick, which answers who on your team may
do a given thing. The same menu sorts by name, most people, most permissions,
newest or last changed, and so does clicking the head of a column.

J and K move through the list and Enter opens the row they rest on. A right
click on a role offers to open it, see who carries it, duplicate it, copy its
name, id or link, and delete it.

## A role

Picking a role folds the list to a column on the left and slides it in beside
it. The cross or Escape folds it away again, with the list as it was. Every
role has its own address, `/admin/roles/role_...`, with the open tab part of
it, so a link from Team or the command palette opens on it.

The head says whether you carry it yourself, whether it holds every
permission and requires two-factor, and when it last changed. Under it: how
many permissions it holds, how many people carry it and how many of them lack
two-factor, whether two-factor is required, and when and by whom it was made
and last changed.

| Tab         | What it holds | Needs |
| ----------- | ------------- | ----- |
| Permissions | Its name and description, every permission and two-factor, and what that adds up to | |
| People      | Who carries it, the open invitations that give it, and giving it to somebody else | |
| Activity    | Every change to the role and to who carries it, with a link to the full log | `view_activity_logs` |

## What a role allows

The Permissions tab lists every permission there is, grouped by the screen
it belongs to, each with a line saying what it lets somebody do. Tick them one
at a time, or a whole group with the box beside its name. A search narrows the
list to the permissions you are after. Managing something includes seeing it,
so ticking the manage permission of mail, the calendar, storage or live
monitoring includes the view permission, which then shows as coming with it.

**Every permission** gives the role everything, also what the platform adds
later, so your own full access role never falls behind. **Require
two-factor** sends whoever carries it to set up a passkey or an authenticator
app before the admin panel opens for them.

Beside the permissions a column reads the role back as it stands, before you
save: which areas it opens and how many permissions that is, what it hands
over that is hard to take back (paying out, deleting traders, API keys,
payments, managing roles), who it reaches including the mailboxes and
calendars shared with it, and what would go wrong if you saved it now. It
warns when the role holds nothing, holds everything, hands over something
sensitive without two-factor, when people who carry it lack the two-factor
you are about to require, and when a change to your own role would take
something from you: without **View roles** this screen closes for you, and
without **Manage roles** you can no longer change any role, this one
included.

Every change is collected by the bar at the bottom of the screen and saved
together. Only what you changed is sent, so a colleague who changed another
permission of the same role in the meantime keeps their change. A role takes
effect on the next click of everybody who carries it.

## Who carries it

The People tab lists everybody who carries the role, with their email
address, whether they lack two-factor, whether they can sign in, when they
joined and when they were last active. Open somebody on Team for their
sign-in and sessions.

**Give it to somebody** searches by name, email address or `usr_` id among
the teammates with another role, who move to this one, and the traders of
your firm who can sign in, who join the team with it. Finding teammates needs
`view_team`, finding traders `view_traders`. **Remove from the team** takes
the role from somebody, who keeps their trader account and loses the admin
panel on their next click.

These are changes like the permissions: they are marked in the list, can be
undone before saving, and the bar at the bottom saves them together. Your own
role is somebody else's to change, so you cannot add or remove yourself.

Below the people, the invitations that give this role and were not accepted
yet, with who sent them and when they expire. With `manage_team` you can
revoke one there, after a question first, and its link stops working at
once. New invitations are sent from **New** on Team, where the role is picked
along with the email address.

## A new role

**New role** opens the form beside the list. Start empty, from one of the
templates (administrator, support agent, fraud and compliance analyst, finance
manager, trading operations, content and marketing), or as a copy of a role
you have, which **Duplicate** on a role also does. The start fills in the name
and the permissions, and everything can be changed before the bar at the
bottom creates it. Two roles cannot share a name.

## Deleting a role

**Delete role** asks first what happens to the people who carry it and the
invitations that give it:

- **Give them another role.** They keep the admin panel, with what that role
  allows, and the open invitations give that role instead.
- **Remove them from the team.** They keep their trader account and lose the
  admin panel on their next click. The open invitations are revoked.

Mailboxes and calendars shared with the role stop being shared through it.
Deleting cannot be undone, and the role you carry yourself is somebody else's
to delete.

## In the older designs

Propper - OG and Tactical keep a table of the roles with a page of its own to
make or edit one, its permissions as a grid, and its people below it. Saving
there sends the whole role, and deleting a role takes everybody who carries
it off the team and revokes its open invitations. Searching and filtering the
roles, the Activity tab, starting from a copy of a role, moving a teammate
from another role to this one, translated permission names and moving
people to another role on delete are only in the standard design.