Skip to main content

group_grants

Creates, updates, deletes, gets or lists a group_grants resource.

Overview

Namegroup_grants
TypeResource
Idsnowflake.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:

NameAccessible byRequired ParamsOptional ParamsDescription
grantinsertgrantee_type, grantee_name, bulk_grant_type, securable_type_plural, scope_type, scope_name, endpointEndpoint to indicate that the privileges listed in the request body should be granted to all securables of this type in the given scope.
revokedeletegrantee_type, grantee_name, bulk_grant_type, securable_type_plural, scope_type, scope_name, privilege, endpointdeleteModeEndpoint 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.

NameDatatypeDescription
bulk_grant_typestringString that species whether this group privilege should be on ALL or FUTURE resources of the specified plural type
endpointstringOrganization and account identifier (orgname-accountname) (default: orgname-accountname)
grantee_namestringString that specifies the name of the privilege grantee.
grantee_typestringString that specifies the type of resource that is the privilege grantee.
privilegestringString that specifies a privilege to be revoked
scope_namestringString that specifies the name of resource that is the scope of an ALL/FUTURE privilege
scope_typestringString that specifies the type of resource that is the scope of an ALL/FUTURE privilege. Can only be DATABASE or SCHEMA
securable_type_pluralstringString 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"
deleteModestringIf "cascade", recursively revoke the grant from sub-grantees to which this privilege was re-granted. Acceptable values are "restrict" or "cascade".

INSERT examples

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
;

DELETE examples

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 }}'
;