> For the complete documentation index, see [llms.txt](https://codemash.gitbook.io/codemash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codemash.gitbook.io/codemash/cloud/membership/roles/edit.md).

# Edit a role

Change a role's description and policies, or look at a system role.

**Where:** Membership → Roles → click a role · `/projects/<project>/membership/roles/<roleId>/edit`

## Before you start

* The role exists — see [Create a role](/codemash/cloud/membership/roles/new.md). System roles open read only.
* You need the `membership:update` permission on roles.

## Steps

1. In **Roles**, click the role, for example `content-editor`. The screen **Editing role** opens with the saved values; **Role name** is locked. Tick **Managed only** to see your policies with their ticks.

   <figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-07c052a815691457ba097f10a417f6b06341f638%2Froles-edit-1.png?alt=media" alt="Editing role content-editor: Role name locked, Description, Managed only ticked, content-editing and orders-read ticked, Cancel and Save"><figcaption><p>Editing a custom role.</p></figcaption></figure>
2. Change **Description** or tick other policies:

   | Field             | Required | What it does                  | Example                                                 |
   | ----------------- | -------- | ----------------------------- | ------------------------------------------------------- |
   | Description       | no       | What the role is for.         | `Writes and edits articles; reads orders and invoices.` |
   | Attached policies | no       | The policies the role grants. | `content-editing`, `orders-read`                        |
3. Press **Save**.

A **System** role opens as **Displaying system role**: its name, description and policies are shown, with no **Save** and no **Delete**.

<figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-58e734c87f44042ba4ae36eea40c437633cee3db%2Froles-edit-2.png?alt=media" alt="Displaying system role Viewer: Read-only access to every module, with its read only system policies listed"><figcaption><p>A system role, read only.</p></figcaption></figure>

## Result

Cloud goes back to **Roles**. The new policy set applies at once to every user who has the role.

## Change or remove it later

* **Delete** — [Delete a role](/codemash/cloud/membership/roles/delete.md).

## Do it from code

```ts
const id = 'pr_5ArJCRo2mJ90H2Fp1oU6ta_nr_3Iy2Q4TDSwBvrxe0Rm0fjV'; // billing-clerk
const invoices = 'pol_7Gs1SuO982DcEHZ0lD5l0a', orders = 'pol_1oRlzIGnF3lzemVoX1nwyy';
await norbix.hub.membership.updateRolePolicies({
  id, roleName: 'billing-clerk', description: 'Reads invoices and orders.',
  policies: [invoices, orders],
});
await new Promise((r) => setTimeout(r, 2000)); // the change reaches the read side a moment later
const { role } = await norbix.hub.membership.getRole({ id });
console.log(role.description, role.attachedPolicies); // [ 'pol_…', 'pol_…' ]
```

```sh
norbix hub membership role policies update pr_5ArJCRo2mJ90H2Fp1oU6ta_nr_2ZHOKi8YUQOhq9Mr5Gn3wT --roleName drafts-reader --description 'Reads drafts and orders.' --policies pol_55EQ74dP3HciwimFfkM5I1,pol_1oRlzIGnF3lzemVoX1nwyy
```

Send the full policy list: it replaces the old one. The client setup is on the [Membership page](/codemash/cloud/membership.md#use-it-from-code). API: [Update Role Policies](/codemash/api-reference/membership/roles/update-role-policies.md) · [Get Role](/codemash/api-reference/membership/roles/get-role.md)
