Skip to main content

privileges

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

Overview

Nameprivileges
TypeResource
Idsnowflake.grant.privileges

Fields

SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.

Methods

NameAccessible byRequired ParamsDescription
grant_group_privilegeINSERTbulkGrantType, granteeName, granteeType, scopeName, scopeType, securableTypePlural, endpointEndpoint to indicate that the privileges listed in the request body should be granted to all securables of this type in the given scope.
grant_privilegeINSERTgranteeName, granteeType, securableName, securableType, endpointEndpoint to indicate that the privileges listed in the request body should be granted.
revoke_group_privilegeDELETEbulkGrantType, granteeName, granteeType, privilege, scopeName, scopeType, securableTypePlural, endpointEndpoint to indicate that the privilege listed on the group securable in the given scope should be revoked.
revoke_privilegeDELETEgranteeName, granteeType, privilege, securableName, securableType, endpointEndpoint to indicate that the privilege listed in the path should be revoked.

INSERT example

Use the following StackQL query and manifest file to create a new privileges resource.

/*+ create */
INSERT INTO snowflake.grant.privileges (
data__privileges,
data__grant_option,
data__created_on,
data__grantee_type,
data__grantee_name,
data__securable_type,
data__securable_name,
data__granted_by_role_type,
data__granted_by_name,
granteeName,
granteeType,
securableName,
securableType,
endpoint
)
SELECT
'{{ privileges }}',
'{{ grant_option }}',
'{{ created_on }}',
'{{ grantee_type }}',
'{{ grantee_name }}',
'{{ securable_type }}',
'{{ securable_name }}',
'{{ granted_by_role_type }}',
'{{ granted_by_name }}',
'{{ granteeName }}',
'{{ granteeType }}',
'{{ securableName }}',
'{{ securableType }}',
'{{ endpoint }}'
;

DELETE example

Deletes the specified privileges resource.

/*+ delete */
DELETE FROM snowflake.grant.privileges
WHERE granteeName = '{{ granteeName }}'
AND granteeType = '{{ granteeType }}'
AND privilege = '{{ privilege }}'
AND securableName = '{{ securableName }}'
AND securableType = '{{ securableType }}'
AND endpoint = '{{ endpoint }}';