> For the complete documentation index, see [llms.txt](https://v2.dataos.info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://v2.dataos.info/operate/access-control/roles-and-permissions/runasuser-permissions/grant-permissions.md).

# Grant permissions

Grant an application user the permissions it needs, then grant developers RunAsUser to act under its identity.

## How to set up a user's permissions?

Before anyone can use an application user's identity, the application user must hold the right permissions. What those permissions are depends entirely on why the application user was created and what the people using it will need to do.

These steps are not specific to application users. The same process applies when granting permissions to any user in DataOS.

{% hint style="info" %}
Only the **Run As User** grant is Operator-only, and it is made in Bifrost. Every other permission, such as `Can Use`, `Can Edit`, and `Can Manage Access` on a Resource, is granted from the Resource's **Access** tab in the **Resource Catalog**, which a Tenant Admin can do. See [Manage access](https://v2.dataos.info/operate/tenant-admin/governance.md).
{% endhint %}

{% stepper %}
{% step %}

#### Add a role

In the user's profile in Bifrost, go to the **Tags** tab and click **Add Role**. Select the appropriate role for the Tenant.

<details>

<summary>Show screenshot</summary>

<figure><img src="https://3708017598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAjg0LlodDVRaNWLSqorQ%2Fuploads%2Fgit-blob-750e6523eb793f128c07ba39dc4759b78002bce3%2Fappuser-add-role-modal.png?alt=media" alt="Add Role modal with Engineering Data Developer role selected"><figcaption><p>Assigning a role to the user</p></figcaption></figure>

</details>
{% endstep %}

{% step %}

#### Confirm role tag

Once added, the role tag appears alongside the identity tag in the user's Tags tab.

<details>

<summary>Show screenshot</summary>

<figure><img src="https://3708017598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAjg0LlodDVRaNWLSqorQ%2Fuploads%2Fgit-blob-86c32a0294c58cf45bfb4674f314f9491b9d3ee2%2Fappuser-tags-with-role.png?alt=media" alt="Tags tab showing both the role tag and identity tag"><figcaption><p>Role assigned: the user now has an authorization boundary in the Tenant</p></figcaption></figure>

</details>
{% endstep %}

{% step %}

#### Grant additional use-cases if needed

If the assigned role does not already cover all the access needed, additional use-cases can be granted from the **Grants** tab.

<details>

<summary>Show screenshot</summary>

<figure><img src="https://3708017598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAjg0LlodDVRaNWLSqorQ%2Fuploads%2Fgit-blob-770f61a65a538926dbc61d9d96dfa02ce18d4a4b%2Fappuser-grants-empty.png?alt=media" alt="Grants tab before any use-cases are assigned"><figcaption><p>Grants tab: grant additional use-cases here if required</p></figcaption></figure>

</details>
{% endstep %}
{% endstepper %}

## How to grant RunAsUser to a user?

Once the application user has the right permissions in place, the Operator grants the Run As User use-case to anyone who needs to act under that identity. This allows them to set `runAsUser` in a manifest and act under the application user's identity.

The grant is made on the **application user's profile**, not the grantee's. The Operator specifies the grantee's user ID as the subject of the grant.

{% stepper %}
{% step %}

#### Open application user’s Grants tab

From the DataOS home, go to **Bifrost** and open the **Users** tab. Open the application user's profile and go to the **Grants** tab.

<details>

<summary>Show screenshot</summary>

<figure><img src="https://3708017598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAjg0LlodDVRaNWLSqorQ%2Fuploads%2Fgit-blob-b70f5ed597fc2445c153eb56e4d6635ce6d4758a%2Frunasuser-grants-tab.png?alt=media" alt="Application user&#x27;s Grants tab in Bifrost"><figcaption></figcaption></figure>

</details>
{% endstep %}

{% step %}

#### Start grant

Click **Grant Use-Case**.
{% endstep %}

{% step %}

#### Select Run As User use-case

In the use-case search field, type **run as** and select **Run As User – run as a user in the DataOS, when applying runnable resources**.

<details>

<summary>Show screenshot</summary>

<figure><img src="https://3708017598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAjg0LlodDVRaNWLSqorQ%2Fuploads%2Fgit-blob-334695277837c5c9d3588af0e1bfafc7937df662%2Frunasuser-grant-usecase-search.png?alt=media" alt="Grant Use-Case dialog with Run As User selected"><figcaption></figcaption></figure>

</details>
{% endstep %}

{% step %}

#### Enter grantee user ID

In the `userId` field, enter the user ID of the person who will be allowed to run as this application user.

<details>

<summary>Show screenshot</summary>

<figure><img src="https://3708017598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAjg0LlodDVRaNWLSqorQ%2Fuploads%2Fgit-blob-d90723c552a1fd3c61d63193b933d989b43e155d%2Frunasuser-grant-usecase-userid.png?alt=media" alt="Grant form showing the userId field"><figcaption></figcaption></figure>

</details>
{% endstep %}

{% step %}

#### Grant use-case

Click **Grant**.

The grant appears in the application user's Grants tab. The grantee can now set `runAsUser` to the application user's ID in any manifest.

<details>

<summary>Show screenshot</summary>

<figure><img src="https://3708017598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAjg0LlodDVRaNWLSqorQ%2Fuploads%2Fgit-blob-5e7a3265a607c909c21bd862a9e7c4a6ccdcb47c%2Frunasuser-grant-result.png?alt=media" alt="Grants tab showing the new Run As User grant"><figcaption></figcaption></figure>

</details>
{% endstep %}
{% endstepper %}

Once granted, the grantee sets `runAsUser` to the application user's ID in their manifest:

```yaml
spec:
  runAsUser: dpdeveloper
```

The resource runs under the application user's identity and inherits its permissions, without any user needing individual grants.

## How to revoke RunAsUser from a user?

To revoke a previously granted Run As User permission, the Operator follows these steps:

{% stepper %}
{% step %}

#### Open existing grant

Go to the **application user's** Grants tab on Bifrost and click on the `run-as-user` entry.

<details>

<summary>Show screenshot</summary>

<figure><img src="https://3708017598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAjg0LlodDVRaNWLSqorQ%2Fuploads%2Fgit-blob-b047c259493cca45160a0042cf5ab828bc060fc5%2Frunasuser-revoke.png?alt=media" alt="Grants tab showing the run-as-user entry"><figcaption></figcaption></figure>

</details>
{% endstep %}

{% step %}

#### Remove subject

In the grant detail, click the delete icon next to the subject tag.
{% endstep %}

{% step %}

#### Confirm deletion

Confirm the deletion by clicking **OK**.

<details>

<summary>Show screenshot</summary>

<figure><img src="https://3708017598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAjg0LlodDVRaNWLSqorQ%2Fuploads%2Fgit-blob-1647c6d4cd28bf1a64d0ee14022217f48d33a458%2Frunasuser-revoke-confirm.png?alt=media" alt="Confirmation dialog for removing the subject"><figcaption></figcaption></figure>

</details>

The grant is removed and the grantee no longer appears in the application user's Grants list.

<details>

<summary>Show screenshot</summary>

<figure><img src="https://3708017598-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAjg0LlodDVRaNWLSqorQ%2Fuploads%2Fgit-blob-66c6132cd55dbdc8369fae875cef7b7b0cb21c7c%2Frunasuser-revoke-result.png?alt=media" alt="Grants list after the subject is removed"><figcaption></figcaption></figure>

</details>
{% endstep %}
{% endstepper %}

> After revocation, any resource that uses `runAsUser` with that user's ID will fail at runtime.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://v2.dataos.info/operate/access-control/roles-and-permissions/runasuser-permissions/grant-permissions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
