Reputation: 13
We want to replace our Ownership to SECURITYADMIN from one user to another
Upvotes: 1
Views: 1522
Reputation: 10039
First of all, Snowflake applies "Role-based Access Control (RBAC)". Therefore you should not consider granting privileges directly to users. It's not possible. All privileges are assigned to roles, and those roles are assigned to users.
You mentioned SECURITYADMIN. It is a pre-defined role that is not owned by any other role. Why do you want to change the ownership of it? If you want to assign SECURITYADMIN from one user to another, you just need to run these commands:
USE ROLE ACCOUNTADMIN;
GRANT ROLE SECURITYADMIN TO USER NEW_USER;
REVOKE ROLE SECURITYADMIN FROM USER OLD_USER;
As you will assign privileges to roles, you can just grant the role to another user, so they will have the same privileges.
You can use GRANT command to add privileges:
https://docs.snowflake.com/en/sql-reference/sql/grant-privilege.html
You can use GRANT OWNERSHIP to transfer the ownership:
https://docs.snowflake.com/en/sql-reference/sql/grant-ownership.html
Upvotes: 1
Reputation: 1642
Grant Ownership command is an option to achieve this requirement: https://docs.snowflake.com/en/sql-reference/sql/grant-ownership.html#:~:text=Transfers%20ownership%20of%20an%20object,see%20Access%20Control%20in%20Snowflake.
To add privileges, use the "Grant" command on the specific objects and assign to specific roles. https://docs.snowflake.com/en/sql-reference/sql/grant-privilege.html
Upvotes: 0