- Categories:
Context functions (Session Object)
IS_ GRANTED_ TO_ INVOKER_ ROLE¶
如果 INVOKER_ROLE 函数返回的角色根据调用函数的上下文继承实参中指定角色的权限,则返回 TRUE。
INVOKER_ROLE 函数仅标识并返回执行 SQL 语句的对象的账户角色。不支持数据库角色。
语法
实参
'string_literal'角色的名称。
使用说明
-
If using the IS_GRANTED_TO_INVOKER_ROLE function with masking policy or a row access policy, verify that your Snowflake account is Enterprise Edition or higher.
-
只能传递一个角色名称作为实参。
-
下表总结了可以在其中调用函数的上下文以及 Snowflake 评估的角色层次结构。
Context Evaluated role User CURRENT_ROLE Table CURRENT_ROLE. View View owner role. UDF UDF owner role. Stored procedure with caller’s right CURRENT_ROLE. Stored procedure with owner’s right Stored procedure owner role. Task Task owner role. Stream The role that queries a given stream. -
If prefer to evaluate the role hierarchy for the current session, call IS_ROLE_IN_SESSION instead.
示例
直接调用该函数:
在掩码策略正文中指定该函数: