> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GRANT SQL-GPT Context Permission

[SQL-GPT](https://docs.kinetica.com/content/sql-gpt/concepts.md) *context permissions*,
which allow management of
[SQL-GPT contexts](https://docs.kinetica.com/content/sql/sqlgpt/create-context.md#sql-gpt-create-context),
can be granted directly to
[users](https://docs.kinetica.com/content/security/sec_concepts.md#security-concepts-users) or
[roles](https://docs.kinetica.com/content/security/sec_concepts.md#security-concepts-roles).

```sql title="GRANT SQL-GPT Context Permission Syntax" theme={null}
GRANT <READ | ADMIN> [PRIVILEGES]
ON <ALL CONTEXTS [IN [SCHEMA] <schema reference>] | CONTEXT <context reference>>
TO <user name | role name> [WITH GRANT OPTION]
```

```sql title="GRANT Create SQL-GPT Context Permission Syntax" theme={null}
GRANT CREATE [PRIVILEGES] ON CONTEXTS
[IN [SCHEMA] <schema reference>]
TO <user name | role name> [WITH GRANT OPTION]
```

| Permission | Description |
| - | - |
| `ADMIN` | Modify or drop the given *context* (includes `READ` access). |
| `READ` | Use the given *context* to generate SQL using a SQL-GPT query. |
| `<context reference>` | The name of the context to which access is being granted, or a wildcard expression signifying the contexts to which access is being granted.  The following forms are valid:   *\<schema>.\<context>*: Fully-qualified context name in the specified schema   `*.*`: All existing contexts that the granting user can see, across all schemas   `*`: All existing schemas the granting user can see, which grants access to all contexts in those schemas now and in the future   *\<schema>*: All contexts in the specified schema   *\<context>*: Context in the default schema. If a schema exists with the same name, it will be used. To avoid this, specify the fully- qualified context name. |
| `<schema reference>` | The schema the permission applies to (with the `ALL` or `CREATE` forms).  If the IN \[SCHEMA] clause is omitted, the permission applies across all schemas, both now and in the future.  Wildcards are not permitted with the IN keyword. |
| `WITH GRANT OPTION` | Grant this permission with a [grant option](https://docs.kinetica.com/content/security/sec_concepts.md#security-concepts-permissions-grant-option) to grant it to others. |

## Examples

To grant *read* access on the *SQL-GPT context* named
**example.atc\_ctx** to the **ctxuser** *user*:

```sql GRANT SQL-GPT Context Permission Example theme={null}
GRANT READ ON CONTEXT example.atc_ctx TO ctxuser
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.