# Grant

[Snowflake Documentation](https://docs.snowflake.com/en/sql-reference/sql/grant-privilege)

Represents a grant of privileges on a resource to a role in Snowflake.

## Examples

### Python

```python
# Global Privs:
grant = Grant(priv="CREATE WAREHOUSE", on="ACCOUNT", to="somerole")
# Warehouse Privs:
grant = Grant(priv="OPERATE", on=Warehouse(name="foo"), to="somerole")
grant = Grant(priv="OPERATE", on_warehouse="foo", to="somerole")
# Schema Privs:
grant = Grant(priv="CREATE TABLE", on=Schema(name="foo"), to="somerole")
grant = Grant(priv="CREATE TABLE", on_schema="foo", to="somerole")
# Table Privs:
grant = Grant(priv="SELECT", on_table="sometable", to="somerole")
```

### YAML

```yaml
- Grant:
    priv: "SELECT"
    on_table: "some_table"
    to: "some_role"
    grant_option: true
```

## Fields

* `priv` (string, required) - The privilege to grant. Examples include 'SELECT', 'INSERT', 'CREATE TABLE'.
* `on` (string or [Resource](https://github.com/Titan-Systems/titan/blob/main/docs/resources/resource.md), required) - The resource on which the privilege is granted. Can be a string like 'ACCOUNT' or a specific resource object.
* `to` (string or [Role](/titan-core/resources/role.md), required) - The role to which the privileges are granted.
* `grant_option` (bool) - Specifies whether the grantee can grant the privileges to other roles. Defaults to False.
* `owner` (string or [Role](/titan-core/resources/role.md)) - The owner role of the grant. Defaults to 'SYSADMIN'.


---

# 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://titan-core.gitbook.io/titan-core/resources/grant.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.
