# REVOKE ROLE

## Syntax <a href="#syntax" id="syntax"></a>

Copy

```sql
REVOKE ROLE role_name [, ...]
[
    FROM USER user_email
    | FROM ROLE role_name [, ...]
];
```

## Description <a href="#description" id="description"></a>

Revoke access to [role](https://docs.deltastream.io/overview/core-concepts/access-control#_role)(s) from a [user](https://docs.deltastream.io/overview/core-concepts/access-control#_user) or other role(s). This prevents a user from [USE ROLE](https://docs.deltastream.io/reference/sql-syntax/command/use) and removes all the [privileges](https://docs.deltastream.io/overview/core-concepts/access-control#_privilege) previously granted to the role, respectively.

The current role requires one of the following privileges:

* Ownership of organization
* `MANAGE_MEMBERS` privilege on organization
* `OWNER` privilege on both parent and child roles (when revoking from role(s))

### Arguments <a href="#arguments" id="arguments"></a>

**role\_name \[, role\_name...]**

One or more [roles](https://docs.deltastream.io/overview/core-concepts/access-control#_role) to revoke.

**user\_email**

Email of the user from whom you are revoking roles.

**role\_name \[, role\_name...]**

One or more [roles](https://docs.deltastream.io/overview/core-concepts/access-control#_role) that are revoked from role(s).

## Examples <a href="#examples" id="examples"></a>

**Revoke role from a user**

```bash
<no-db>/<no-store># REVOKE ROLE custom_role FROM USER 'emailfbdad716-3abf-4484-b783-5ad48d32f039@deltastream.io';
+-------------+------------+------------------------------------------+
|  Type       |  Command   |  Summary                                 |
+=============+============+==========================================+
| role revoke | ALTER      | Role(s) "custom_role" revoked from user  |
|             |            | "emailfbdad716-3abf-4484-b783-5ad48d32f0 |
|             |            | 39@deltastream.io"                       |
+-------------+------------+------------------------------------------+
<no-db>/<no-store># LIST USER ROLES;
+---------------+-------------+-------------+---------------+
|  Name         |  Is Current |  Is Default |  Is Inherited |
+===============+=============+=============+===============+
| orgadmin      | false       | false       | false         |
+---------------+-------------+-------------+---------------+
| public        | false       | false       | true          |
+---------------+-------------+-------------+---------------+
| securityadmin | false       | false       | true          |
+---------------+-------------+-------------+---------------+
| useradmin     | true        | false       | true          |
+---------------+-------------+-------------+---------------+
| sysadmin      | false       | true        | true          |
+---------------+-------------+-------------+---------------+
```

**Revoke role from another role**

```bash
<no-db>/<no-store># DESCRIBE ROLE sysadmin;
+--------------+------------+--------------------------+--------------------+-------------+
|  Type        |  Name      |  Privilege               |  With Grant Option |  Granted By |
+==============+============+==========================+====================+=============+
| role         | public     | usage                    | false              | orgadmin    |
+--------------+------------+--------------------------+--------------------+-------------+
| role         | useradmin  | usage                    | false              | useradmin   |
+--------------+------------+--------------------------+--------------------+-------------+
| organization | uuid...    | create_database          | true               | orgadmin    |
+--------------+------------+--------------------------+--------------------+-------------+
| organization | uuid...    | create_descriptor_source | true               | orgadmin    |
+--------------+------------+--------------------------+--------------------+-------------+
| organization | uuid...    | create_function_source   | true               | orgadmin    |
+--------------+------------+--------------------------+--------------------+-------------+
| organization | uuid...    | create_function          | true               | orgadmin    |
+--------------+------------+--------------------------+--------------------+-------------+
| organization | uuid...    | create_store             | true               | orgadmin    |
+--------------+------------+--------------------------+--------------------+-------------+
| organization | uuid...    | create_query             | true               | orgadmin    |
+--------------+------------+--------------------------+--------------------+-------------+
| organization | uuid...    | usage                    | true               | orgadmin    |
+--------------+------------+--------------------------+--------------------+-------------+
| organization | uuid...    | create_schema_registry   | true               | orgadmin    |
+--------------+------------+--------------------------+--------------------+-------------+
| organization | uuid...    | create_connector         | true               | orgadmin    |
+--------------+------------+--------------------------+--------------------+-------------+
| organization | uuid...    | create_secret            | true               | orgadmin    |
+--------------+------------+--------------------------+--------------------+-------------+
| organization | uuid...    | create_aws_private_link  | true               | orgadmin    |
+--------------+------------+--------------------------+--------------------+-------------+
| role         | useradmin  | usage                    | false              | useradmin   |
+--------------+------------+--------------------------+--------------------+-------------+
<no-db>/<no-store># REVOKE ROLE useradmin FROM ROLE sysadmin;
+-------------+------------+------------------------------------------+
|  Type       |  Command   |  Summary                                 |
+=============+============+==========================================+
| role revoke | ALTER      | Role(s) "useradmin" revoked from         |
|             |            | role(s) "sysadmin"                       |
+-------------+------------+------------------------------------------+
<no-db>/<no-store># DESCRIBE ROLE sysadmin;
+--------------+------------+--------------------------+--------------------+-------------+
|  Type        |  Name      |  Privilege               |  With Grant Option |  Granted By |
+==============+============+==========================+====================+=============+
| role         | public     | usage                    | false              | orgadmin    |
+--------------+------------+--------------------------+--------------------+-------------+
| organization | uuid...    | create_database          | true               | orgadmin    |
+--------------+------------+--------------------------+--------------------+-------------+
| organization | uuid...    | create_descriptor_source | true               | orgadmin    |
+--------------+------------+--------------------------+--------------------+-------------+
| organization | uuid...    | create_function_source   | true               | orgadmin    |
+--------------+------------+--------------------------+--------------------+-------------+
| organization | uuid...    | create_function          | true               | orgadmin    |
+--------------+------------+--------------------------+--------------------+-------------+
| organization | uuid...    | create_store             | true               | orgadmin    |
+--------------+------------+--------------------------+--------------------+-------------+
| organization | uuid...    | create_query             | true               | orgadmin    |
+--------------+------------+--------------------------+--------------------+-------------+
| organization | uuid...    | usage                    | true               | orgadmin    |
+--------------+------------+--------------------------+--------------------+-------------+
| organization | uuid...    | create_schema_registry   | true               | orgadmin    |
+--------------+------------+--------------------------+--------------------+-------------+
| organization | uuid...    | create_connector         | true               | orgadmin    |
+--------------+------------+--------------------------+--------------------+-------------+
| organization | uuid...    | create_secret            | true               | orgadmin    |
+--------------+------------+--------------------------+--------------------+-------------+
| organization | uuid...    | create_aws_private_link  | true               | orgadmin    |
+--------------+------------+--------------------------+--------------------+-------------+
```


---

# 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://docs.deltastream.io/reference/sql-syntax/command/revoke-role.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.
