GRANT and REVOKE privileges on an artifact

Use GRANT and REVOKE to manage READ and WRITE on an individual Snowflake Artifact. These statements don’t grant access to the source file or underlying data. These statements don’t grant access to the source file or underlying data.

Syntax

GRANT { READ | WRITE | READ, WRITE }
  ON ARTIFACT <name>
  TO { ROLE <role_name> | USER <user_name> }
  [ WITH GRANT OPTION ]

REVOKE { READ | WRITE | READ, WRITE }
  ON ARTIFACT <name>
  FROM { ROLE <role_name> | USER <user_name> }
  [ RESTRICT | CASCADE ]

Parameters

<name>

: The artifact’s external UUID as a double-quoted identifier. Find it with SHOW ARTIFACTS, or in an artifact link.

TO | FROM ROLE <role_name> | USER <user_name>

: Names an account role or a user. A user grant targets that user’s personal role.

WITH GRANT OPTION

: Allows the recipient role to pass along the specified privilege, subject to other applicable grant checks.

RESTRICT | CASCADE

: Controls dependent grants on revoke. Availability of this optional syntax can differ from the basic REVOKE statement.

Access control requirements

To grant a privilege, an active role must own the artifact, hold that privilege WITH GRANT OPTION, or hold account-level MANAGE GRANTS. WRITE by itself doesn’t grant authority to share. REVOKE removes the matching grants made by an activated grantor role; account-level MANAGE GRANTS can remove matching grants made by any role. In accounts enforcing managed access, the corresponding artifact-family MANAGE ACCESS privilege or MANAGE GRANTS is also required. The account-wide artifact-sharing setting continues to apply.

Usage notes

  • GRANT WRITE creates a WRITE grant but not a separate READ grant. A WRITE holder can still read the artifact. REVOKE READ alone doesn’t necessarily remove WRITE; revoke both when you intend to remove both.
  • Granting READ to PUBLIC permits everyone in the account to read the artifact, subject to account-wide controls.
  • Artifact grants don’t appear in SHOW GRANTS. Inspect them with SYSTEM$SHOW_ARTIFACT_GRANTS.
  • To transfer ownership, see GRANT OWNERSHIP ON ARTIFACT.

Examples

GRANT READ, WRITE
  ON ARTIFACT "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
  TO ROLE analytics_team;

REVOKE READ, WRITE
  ON ARTIFACT "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
  FROM ROLE analytics_team;