grants_to
Creates, updates, deletes, gets or lists a grants_to
resource.
Overview
Name | grants_to |
Type | Resource |
Id | snowflake.grant.grants_to |
Fields
The following fields are returned by SELECT
queries:
- list_grants_to
Properties of a grant that can be granted to a role or user.
Name | Datatype | Description |
---|---|---|
granted_by_name | string | The role that granted this privilege to this grantee (example: SUBADMIN) |
grantee_name | string | Specific name of object being granted to (example: ACCOUNTADMIN) |
securable_name | string | Name of specific object granted on (not name of privilege!) |
created_on | string (date-time) | |
grant_option | boolean | Can grantee pass this privilege down? |
granted_by_role_type | string | Type of role that granted this privilege to this grantee (example: ROLE) |
grantee_type | string | Entity type being granted to (example: ROLE) |
privileges | array | Privilege type |
securable_type | string | Type of object granted on (example: ACCOUNT) |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
list_grants_to | select | granteeType , granteeName , endpoint | showLimit | List the roles and privileges granted to the specified grantee using the output of SHOW GRANTS TO |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
endpoint | string | Organization and Account Name (default: orgid-acctid) |
granteeName | string | String that specifies the name of the privilege grantee. |
granteeType | string | String that specifies the type of resource that is the privilege grantee. |
showLimit | integer | Query parameter to limit the maximum number of rows returned by a command. |
SELECT
examples
- list_grants_to
List the roles and privileges granted to the specified grantee using the output of SHOW GRANTS TO
SELECT
granted_by_name,
grantee_name,
securable_name,
created_on,
grant_option,
granted_by_role_type,
grantee_type,
privileges,
securable_type
FROM snowflake.grant.grants_to
WHERE granteeType = '{{ granteeType }}' -- required
AND granteeName = '{{ granteeName }}' -- required
AND endpoint = '{{ endpoint }}' -- required
AND showLimit = '{{ showLimit }}';