# RoleGrant

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

Represents a grant of a role to another role or user in Snowflake.

## Examples

### Python

```python
# Grant to Role:
role_grant = RoleGrant(role="somerole", to_role="someotherrole")
role_grant = RoleGrant(role="somerole", to=Role(name="someotherrole"))
# Grant to User:
role_grant = RoleGrant(role="somerole", to_user="someuser")
role_grant = RoleGrant(role="somerole", to=User(name="someuser"))
```

### YAML

```yaml
role_grants:
  - role: somerole
    to_role: someotherrole
  - role: somerole
    to_user: someuser
```

## Fields

* `role` (string or [Role](/titan-core/resources/role.md), required) - The role to be granted.
* `to_role` (string or [Role](/titan-core/resources/role.md)) - The role to which the role is granted.
* `to_user` (string or [User](/titan-core/resources/user.md)) - The user to which the role is granted.


---

# 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/role_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.
