COF-C02 · Question #566
When should a stored procedure be created with caller's rights?
The correct answer is C. When the stored procedure needs to run with the privileges of the role that called the stored. Stored procedures in Snowflake can be created with either 'owner's rights' or 'caller's rights'. A stored procedure created with caller's rights executes with the privileges of the role that calls the procedure, not the privileges of the role that owns the procedure. This is…
Question
When should a stored procedure be created with caller's rights?
Options
- AWhen the caller needs to be prevented from viewing the source code of the stored procedure
- BWhen the caller needs to run a statement that could not execute outside of the stored procedure
- CWhen the stored procedure needs to run with the privileges of the role that called the stored
- DWhen the stored procedure needs to operate on objects that the caller does not have privileges on
How the community answered
(23 responses)- A4% (1)
- B4% (1)
- C91% (21)
Explanation
Stored procedures in Snowflake can be created with either 'owner's rights' or 'caller's rights'. A stored procedure created with caller's rights executes with the privileges of the role that calls the procedure, not the privileges of the role that owns the procedure. This is particularly useful in scenarios where the procedure needs to perform operations that depend on the caller's access permissions, ensuring that the procedure can only access objects that the caller is authorized to
Topics
Community Discussion
No community discussion yet for this question.