# Using the CLI to Manage User Roles

Every DeltaStream organization member belongs to one or more roles. As each role may allow a unique and specific subset of capabilities, in most cases people are assigned multiple roles. Review the basic commands below for details on how to manage someone's roles.

## Listing Roles

Individuals can view their current set of roles via the [`LIST ROLES` ](/reference/sql-syntax/command/list-roles.md)command. In the example below, you can see that while the current role is `sysadmin`, it also has access to other roles including `public`, `orgadmin`, `securityadmin`, and `useradmin`.

```
<no-db>/<no-store># LIST ROLES;
      Name      | Current |      Created at
----------------+---------+-----------------------
  public        |         | 2023-08-09T22:49:46Z
  orgadmin      |         | 2023-08-09T22:49:46Z
  securityadmin |         | 2023-08-09T22:49:46Z
  useradmin     |         | 2023-08-09T22:49:46Z
  sysadmin      | ✓       | 2023-08-09T22:49:46Z
```

## Switching Roles

To switch to a different role, you can can use the [`USE` command](/reference/sql-syntax/command/use.md). The example below shows how to switch from the `sysadmin` role to the `useradmin` role.

```
<no-db>/<no-store># USE ROLE useradmin;
```

Now, if you `LIST ROLES` again, you can see that the current role has changed to `useradmin`.

```
<no-db>/<no-store># LIST ROLES;
      Name      | Current |      Created at
----------------+---------+-----------------------
  public        |         | 2023-08-09T22:49:46Z
  orgadmin      |         | 2023-08-09T22:49:46Z
  securityadmin |         | 2023-08-09T22:49:46Z
  useradmin     | ✓       | 2023-08-09T22:49:46Z
  sysadmin      |         | 2023-08-09T22:49:46Z
```

## Describing a Role

You can also use the [CREATE ROLE](/reference/sql-syntax/ddl/create-role.md) command to learn more information about a specific role.

{% hint style="info" %}
**Note** Your current role must have access to whichever role you wish to describe.
{% endhint %}

The example below shows that the `useradmin` role is also granted the `public` role, and below that you can view the privileges of the role. Since the `useradmin` role is for managing other users, the `ManageMembers` privilege is granted to this role. Other roles may have other privileges.

```
<no-db>/<no-store># DESCRIBE ROLE useradmin;
    Name    |      Created at
------------+-----------------------
  useradmin | 2023-08-09T22:49:46Z

Granted Roles
   Name
----------
  public

Granted Privileges
      Type      |    Target    | ID/Name | Grant option
----------------+--------------+---------+---------------
  ManageMembers | Organization |         | ✓
```


---

# 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/how-do-i.../roles/managing-user-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.
