Secondary Roles in Snowflake. Read Time - 2 Minute, 22 Second - by Sachin Mittal - Snowflake - Medium
Secondary Roles in Snowflake. Read Time - 2 Minute, 22 Second - by Sachin Mittal - Snowflake - Medium
Secondary Roles in Snowflake. Read Time - 2 Minute, 22 Second - by Sachin Mittal - Snowflake - Medium
Sachin Mittal
Oct 27, 2022 · 3 min read · Listen
During this post we will discuss about Primary roles and Secondary Roles.
Follow
Primary Role is your current role. The Role we select by using USE
<<ROLE>> or the default role assigned to the user at the time of creation.
More from Medium
Sometimes when there is no role assign a default PUBLIC role assigns to the
12
user. John Ryan in Snowflake
objects in the union of all the Roles assigned. For example, you could assign Handling Slowly Changing
Dimensions (SCD) using Delta
a sales manager both the Sales Manager Role and the Field Sales Tables
Representative role.
Rajiv Gupta in Dev Genius
ALL: All roles that have been granted to the user in addition to the current
active primary role. Note that the set of roles gets reevaluate when each SQL
statement executes. If additional roles grants to the user, and that user
executes a new SQL statement, the newly granted roles are active secondary
roles for the new SQL statement.
NONE: Disables secondary roles. The authorization for all SQL actions is
provided via the primary role.
Multiple Roles:
Assuming we have multiple Roles in system and each Role holds multiple
tables then it would be tedious for User to switch the Role frequently. Here
the Secondary Roles plays a significance Role.
Secondary Role
We can clearly see DEVELOPER and TESTER Roles are assign to user as
Secondary Roles.
Now try to run the same CUSTOM_TABLE query from the WEBUI and verify
the result.
Roles Tables
Therefore, User has access to all the objects by UNION of all ROLES assign to
it. User need not to remember which particular Role holds which table. He
can directly query the table without switching to multiple roles.
https://cloudyard.in/2022/07/secondary-roles-in-snowflake/