> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-fbfa8bee.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Common RBAC queries

> Queries to help grant specific permissions to users.

{frontMatter.description}

<h2 id="introduction">
  Introduction
</h2>

The following are common queries to help grant specific permissions to users.

<h2 id="how-do-i-grant-the-same-permissions-as-the-current-user-to-another-user">
  How do I grant the same permissions as the current user to another user?
</h2>

```sql theme={null}
GRANT CURRENT GRANTS ON *.* TO another_user;
```

<h2 id="how-do-i-grant-a-specific-permission-to-a-user-based-on-the-grants-of-the-current-user">
  How do I grant a specific permission to a user based on the grants of the current user?
</h2>

In the below example, `another_user` will be able to perform `SELECT` commands on all of the databases and tables of the current user.

```sql theme={null}
GRANT CURRENT GRANTS(SELECT ON *.*) TO another_user;
```

<h2 id="how-do-i-grant-a-specific-permission-to-a-user-for-a-specific-database-based-on-the-grants-of-the-current-user">
  How do I grant a specific permission to a user for a specific database based on the grants of the current user?
</h2>

In the below example, `another_user` will be able to perform `INSERT` commands to all tables in `my_database`.

```sql theme={null}
GRANT INSERT ON my_database.* TO another_user;
```

<h2 id="how-do-i-give-access-to-all-grants-for-a-specific-user-based-on-the-default-user">
  How do I give access to all grants for a specific user based on the default user?
</h2>

```sql theme={null}
GRANT default_role TO another_user;
```
