What privilege is needed for a Snowflake user to see the definition of a secure view?
What privilege is needed for a Snowflake user to see the definition of a secure view?
To see the definition of a secure view in Snowflake, a user needs to have the OWNERSHIP privilege. This privilege allows full control over the object, including viewing its definition. Secure views are designed to restrict access to their definitions unless the user has the appropriate level of privilege, which in this case is OWNERSHIP.
The definition of a secure view is only exposed to authorized users (i.e. users who have been granted the role that owns the view). However, users that have been granted IMPORTED PRIVILEGES privilege on the SNOWFLAKE database or another shared database have access to secure view definitions via the VIEWS Account Usage view. Users granted the ACCOUNTADMIN role or the SNOWFLAKE.OBJECT_VIEWER database role can also see secure view definitions via this view. The preferred, least-privileged means of access is the SNOWFLAKE.OBJECT_VIEWER database role. https://docs.snowflake.com/en/user-guide/views-secure