ARA-C01 · Question #4
An Architect needs to grant a group of ORDER_ADMIN users the ability to clean old data in an ORDERS table (deleting all records older than 5 years), without granting any privileges on the table. The g
The correct answer is C. Create a stored procedure that runs with owner's rights, including the appropriate "> 5 years". A stored procedure using owner's rights (EXECUTE AS OWNER) runs with the privileges of the role that owns the stored procedure - not the role of the user calling it. The ORDER_MANAGER (who has DELETE on the ORDERS table) creates the stored procedure. When ORDER_ADMIN executes it,
Question
An Architect needs to grant a group of ORDER_ADMIN users the ability to clean old data in an ORDERS table (deleting all records older than 5 years), without granting any privileges on the table. The group's manager (ORDER_MANAGER) has full DELETE privileges on the table. How can the ORDER_ADMIN role be enabled to perform this data cleanup, without needing the DELETE privilege held by the ORDER_MANAGER role?
Options
- ACreate a stored procedure that runs with caller's rights, including the appropriate "> 5 years"
- BCreate a stored procedure that can be run using both caller's and owner's rights (allowing the user
- CCreate a stored procedure that runs with owner's rights, including the appropriate "> 5 years"
- DThis scenario would actually not be possible in Snowflake ?any user performing a DELETE on a
How the community answered
(19 responses)- A5% (1)
- B16% (3)
- C74% (14)
- D5% (1)
Explanation
A stored procedure using owner's rights (EXECUTE AS OWNER) runs with the privileges of the role that owns the stored procedure - not the role of the user calling it. The ORDER_MANAGER (who has DELETE on the ORDERS table) creates the stored procedure. When ORDER_ADMIN executes it, the procedure runs under the owner's privileges, including DELETE access, without ORDER_ADMIN ever being granted DELETE directly. This is a classic privilege escalation pattern for controlled access. A caller's rights procedure (A) would run with ORDER_ADMIN's own privileges, meaning it would fail because ORDER_ADMIN lacks DELETE. Option B is not a real Snowflake feature - a procedure runs with either caller's or owner's rights, not both simultaneously. Option D is incorrect - this scenario is precisely what owner's rights stored procedures are designed to enable.
Topics
Community Discussion
No community discussion yet for this question.