CURRENT_ROLE
functionsupportedAccess control (grants, roles)Returns the name of the primary role in use for the current session when the primary role is an account-level role or NULL if the role in use for the current session is a database role. To specify a different role for the session, execute the USE ROLE command.
Syntax
CURRENT_ROLE()
Usage notes
- Granting access on a secure UDF or secure view that contains this function to a share is allowed. When the secure UDF or secure view is accessed from the data sharing consumer account, this function always returns a NULL value.
- Snowflake returns a NULL value if this function is used in a masking policy or row access policy that is assigned to a shared table or view.