Snowflake Function GRANTS

Viewed 552

I have two schemas where number of functions created there. I wanted to grant function to ROLES.

Also wanted to FUTURE GRANT on functions to ROLES.

Do i need to create grant command for each functions. Also do we have future grants on functions?

Thanks Ashok

2 Answers

First, you can grant all on future functions.

grant all on future functions in schema "myDB"."mySchema" to role MyRole;

Then, you can generate the SQL to grant for existing functions:

show functions in schema "MyDB"."MySchema"; 
SELECT 'grant all on function "' || "name" || '" to role MyRole;' FROM  table(result_scan(last_query_id())) where "is_external_function" = 'Y'
Related