> 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.md).

# Roles

Roles bundle policies and are given to users — role-based access control (RBAC) for your project.

**Where:** Membership → Roles · `/projects/<project>/membership/roles`

A **role** bundles one or more [policies](/codemash/cloud/membership/policies.md) and is given to users. A user can do what the policies of all their roles allow — this is role-based access control (RBAC). Roles belong to one project. Every project starts with seven **System** roles; the roles you add are **Custom**.

<figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-a57581ebfeaa9a3a28678847b48879b43a3c7207%2Froles-list-1.png?alt=media" alt="Roles list: Administrator, Authenticated, Guest, Viewer, Data Editor, Developer, Admin Portal Manager (System) and support-agent, content-editor (Custom) with their policy counts"><figcaption><p>Roles list with real rows.</p></figcaption></figure>

## Columns, search and filters

| Column    | What it shows                                           |
| --------- | ------------------------------------------------------- |
| Role Name | The role. Click it to open it.                          |
| Type      | **System** (built in, read only) or **Custom** (yours). |
| Policies  | How many policies the role carries.                     |

The list has no search and no filters. **Add New** is off without the `membership:create` permission on roles. Keep roles few and easy to read (`content-editor`, `support-agent`) and put the detail into policies.

## What you can do here

* [Create a role](/codemash/cloud/membership/roles/new.md)
* [Edit a role](/codemash/cloud/membership/roles/edit.md) — and look at a system role
* [Delete a role](/codemash/cloud/membership/roles/delete.md)
* Give a role to a user — [Add a user](/codemash/cloud/membership/users/new.md) or [Edit a user](/codemash/cloud/membership/users/edit.md)

## Do it from code

```ts
const { roles } = await norbix.hub.membership.getRoles();
console.log(roles.map((r) => `${r.displayName ?? r.name} (${r.isSystem ? 'System' : 'Custom'})`));
// [ 'Administrator (System)', …, 'support-agent (Custom)', 'content-editor (Custom)' ]
```

```sh
norbix hub membership roles get
```

The client setup is on the [Membership page](/codemash/cloud/membership.md#use-it-from-code). API: [Get Roles](/codemash/api-reference/membership/roles/get-roles.md) · Concept: [Permissions](/codemash/cloud/concepts/permissions.md)
