雪花有哪些出站特权

时间:2020-03-05 15:27:45

标签: snowflake-cloud-data-platform

在雪花grant ownership documentation中,提到了“传出特权”。

什么是“传出特权”?

这是可选参数“复制/撤销当前资助”的一部分。

它说:“转移对象的所有权以及该对象上任何现有出站特权的副本。”

我试图弄清楚什么是“出站特权”。

编辑: 这是我进行的测试。我没看到区别。

create or replace view sandbox.test_schema.my_test_view
as
select 1 a;

grant ownership on view sandbox.test_schema.my_test_view to role ABC

show grants on view sandbox.test_schema.my_test_view

特权=所有权; grant_to =角色; grantee_name = ABC; grant_option = true; grant_by = ABC

如果我添加复制许可

如果相反,除了复制授予特权外,我运行的所有内容完全相同

grant ownership on view sandbox.test_schema.my_test_view to role ABC copy current grants

在视图上显示授权的结果是相同的。

是否存在“复制当前赠款”有所作为的示例?

1 个答案:

答案 0 :(得分:1)

“出站特权”是指对象上的现有特权(当前授予)。

所以您更新了样本,并询问是否存在“复制当前赠款”有所作为的示例?

假设还有另一个角色(DEF),我们在示例视图中授予了select:

create role DEF;
grant select on sandbox.test_schema.my_test_view to role DEF;

在这种情况下,以下命令将失败并显示“ SQL执行错误:对安全对象'DEF'的安全性'SANDBOX.TEST_SCHEMA.MY_TEST_VIEW'的依赖授予的权限'SELECT'”:

grant ownership on view sandbox.test_schema.my_test_view to role ABC;

要解决此问题:

1)我们可以手动删除现有的赠款,然后重试第一条语句:

revoke select on sandbox.test_schema.my_test_view from role DEF;
grant ownership on view sandbox.test_schema.my_test_view to role ABC;

2)我们可以自动删除现有的赠款:

grant ownership on view sandbox.test_schema.my_test_view to role ABC revoke current grants;

3)我们可以在更改所有权的同时保留现有赠款:

grant ownership on view sandbox.test_schema.my_test_view to role ABC copy current grants;

因此,如果对象上已有授予,则“ COPY / REVOKE当前授予”会有所不同。

相关问题