# 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](https://titan-core.gitbook.io/titan-core/resources/role), required) - The role to be granted.
* `to_role` (string or [Role](https://titan-core.gitbook.io/titan-core/resources/role)) - The role to which the role is granted.
* `to_user` (string or [User](https://titan-core.gitbook.io/titan-core/resources/user)) - The user to which the role is granted.
