# Roles and Cluster Roles

**Adding Roles or Cluster Roles**

To add a Role or a Cluster Role, begin by selecting the "Roles" tab on the RBAC View. Then, on the left panel where the list of all existing roles and cluster roles is displayed, click on the plus button located on the header of the list.

<figure><img src="/files/0gNWHWUrWLcMmZ9Rd5Ae" alt=""><figcaption></figcaption></figure>

The Add Role Dialog will appear. Depending on your preferences, choose from the options "Role" or "Cluster Role." Set a name, and if you're selecting a Role, you'll also need to choose a namespace. Click on "Add," and your Role or Cluster Role will be created.

<figure><img src="/files/U0dV0MTB2mDvoC4MqUmO" alt=""><figcaption><p>Add Role</p></figcaption></figure>

**Defining Permissions:**

To set the permissions in a Role or Cluster Role, navigate to the central panel called "Permissions."

Click on the "Add" button to add a new permission. Then, use the inline editor to define the namespace, resources, API group, as well as the verbs that the permission allows (create, update, patch, delete, etc.).

To delete any permissions, select the row on the grid and click on the delete button.&#x20;

Any changes made using the permission editor will be reflected in the YML Editor at the bottom, or vice versa. Any CRUD operations on the permissions can be directly performed in the YML editor at the bottom. This will also synchronize the permission editor, ensuring consistency between the two interfaces.

<figure><img src="/files/lVjLvmdhx0MyFLfQfEsp" alt=""><figcaption><p>Role / Cluster Role Permissions</p></figcaption></figure>

**User Usage:**

One useful view located on the far right of the screen is the user section. Once a role or cluster role is selected, this section will display any user, group, or service account that has a binding to the selected role or cluster role.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.k8studio.io/documentation/rbac-view/roles-and-cluster-roles.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
