group_grants
Creates, updates, deletes, gets or lists a group_grants resource.
Overview
| Name | group_grants |
| Type | Resource |
| Id | snowflake.grants.group_grants |
Fields
The following fields are returned by SELECT queries:
SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
grant | insert | grantee_type, grantee_name, bulk_grant_type, securable_type_plural, scope_type, scope_name, endpoint | Endpoint to indicate that the privileges listed in the request body should be granted to all securables of this type in the given scope. | |
revoke | delete | grantee_type, grantee_name, bulk_grant_type, securable_type_plural, scope_type, scope_name, privilege, endpoint | deleteMode | Endpoint to indicate that the privilege listed on the group securable in the given scope should be revoked. |
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 |
|---|---|---|
bulk_grant_type | string | String that species whether this group privilege should be on ALL or FUTURE resources of the specified plural type |
endpoint | string | Organization and account identifier (orgname-accountname) (default: orgname-accountname) |
grantee_name | string | String that specifies the name of the privilege grantee. |
grantee_type | string | String that specifies the type of resource that is the privilege grantee. |
privilege | string | String that specifies a privilege to be revoked |
scope_name | string | String that specifies the name of resource that is the scope of an ALL/FUTURE privilege |
scope_type | string | String that specifies the type of resource that is the scope of an ALL/FUTURE privilege. Can only be DATABASE or SCHEMA |
securable_type_plural | string | String that specifies the plural of the type of resource that is being secured by an ALL/FUTURE privilege. Must be either "schemas" or any plural object type that can nest under a schema such as "tables" |
deleteMode | string | If "cascade", recursively revoke the grant from sub-grantees to which this privilege was re-granted. Acceptable values are "restrict" or "cascade". |
INSERT examples
- grant
- Manifest
Endpoint to indicate that the privileges listed in the request body should be granted to all securables of this type in the given scope.
INSERT INTO snowflake.grants.group_grants (
privileges,
grant_option,
created_on,
grantee_type,
grantee_name,
securable_type,
securable_name,
granted_by_role_type,
granted_by_name,
grantee_type,
grantee_name,
bulk_grant_type,
securable_type_plural,
scope_type,
scope_name,
endpoint
)
SELECT
'{{ privileges }}',
{{ grant_option }},
'{{ created_on }}',
'{{ grantee_type }}',
'{{ grantee_name }}',
'{{ securable_type }}',
'{{ securable_name }}',
'{{ granted_by_role_type }}',
'{{ granted_by_name }}',
'{{ grantee_type }}',
'{{ grantee_name }}',
'{{ bulk_grant_type }}',
'{{ securable_type_plural }}',
'{{ scope_type }}',
'{{ scope_name }}',
'{{ endpoint }}'
RETURNING
status
;
# Description fields are for documentation purposes
- name: group_grants
props:
- name: grantee_type
value: "{{ grantee_type }}"
description: Required parameter for the group_grants resource.
- name: grantee_name
value: "{{ grantee_name }}"
description: Required parameter for the group_grants resource.
- name: bulk_grant_type
value: "{{ bulk_grant_type }}"
description: Required parameter for the group_grants resource.
- name: securable_type_plural
value: "{{ securable_type_plural }}"
description: Required parameter for the group_grants resource.
- name: scope_type
value: "{{ scope_type }}"
description: Required parameter for the group_grants resource.
- name: scope_name
value: "{{ scope_name }}"
description: Required parameter for the group_grants resource.
- name: endpoint
value: "{{ endpoint }}"
description: Required parameter for the group_grants resource.
- name: privileges
value:
- "{{ privileges }}"
description: |
Privilege type
- name: grant_option
value: {{ grant_option }}
description: |
Can grantee pass this privilege down?
- name: created_on
value: "{{ created_on }}"
- name: grantee_type
value: "{{ grantee_type }}"
description: |
Entity type being granted to
- name: grantee_name
value: "{{ grantee_name }}"
description: |
Specific name of object being granted to
- name: securable_type
value: "{{ securable_type }}"
description: |
Type of object granted on
- name: securable_name
value: "{{ securable_name }}"
description: |
Name of specific object granted on (not name of privilege!)
- name: granted_by_role_type
value: "{{ granted_by_role_type }}"
description: |
Type of role that granted this privilege to this grantee
- name: granted_by_name
value: "{{ granted_by_name }}"
description: |
The role that granted this privilege to this grantee
DELETE examples
- revoke
Endpoint to indicate that the privilege listed on the group securable in the given scope should be revoked.
DELETE FROM snowflake.grants.group_grants
WHERE grantee_type = '{{ grantee_type }}' --required
AND grantee_name = '{{ grantee_name }}' --required
AND bulk_grant_type = '{{ bulk_grant_type }}' --required
AND securable_type_plural = '{{ securable_type_plural }}' --required
AND scope_type = '{{ scope_type }}' --required
AND scope_name = '{{ scope_name }}' --required
AND privilege = '{{ privilege }}' --required
AND endpoint = '{{ endpoint }}' --required
AND deleteMode = '{{ deleteMode }}'
;