iotdb icon indicating copy to clipboard operation
iotdb copied to clipboard

[v0.12.2]用户与角色UDF权限赋予无法正确生效,查询报错"Msg: 602: No permissions for this operation UDTF"

Open BraggingMan opened this issue 5 years ago • 1 comments

Describe the bug

参考文档 IotDB Permission Operation Doc 和 UDF Requirements Doc, 我们希望将用户定义函数UDF的权限赋予新建的用户和角色中。但是当我尝试使用赋权命令向非"root"前缀的nodename 赋予"READ_TIMESERIES", "DROP_FUNCTION", "CREATE_FUNCTION"三个必须的权限时,出现了权限失效的情况。

To Reproduce

  1. 建立了两个用户udtf_test1和udtf_test2; create user udtf_test1 'xxxxxxxx' create user udtf_test2 'xxxxxxxx'
  2. 建立了两个角色,udtf_test_role1和udtf_test_role2 CREATE ROLE udtf_test_role1 CREATE ROLE udtf_test_role2
  3. 分别将权限赋予root 和 root.test GRANT ROLE udtf_test_role1 PRIVILEGES 'SET_STORAGE_GROUP','CREATE_TIMESERIES','INSERT_TIMESERIES','READ_TIMESERIES','DELETE_TIMESERIES','DROP_FUNCTION','CREATE_FUNCTION' ON root GRANT ROLE udtf_test_role2 PRIVILEGES 'SET_STORAGE_GROUP','CREATE_TIMESERIES','INSERT_TIMESERIES','READ_TIMESERIES','DELETE_TIMESERIES','DROP_FUNCTION','CREATE_FUNCTION' ON root.test 4.将角色权限赋予用户 GRANT udtf_test_role1 TO udtf_test1 GRANT udtf_test_role2 TO udtf_test2
  4. 分别使用两个用户执行查询 select xxx from yyy where time >= 2021-01-01 and time<= 2021-01-31 23:59:59
  5. udtf_test1可正确执行,udtf_test2报错:Msg: 602: No permissions for this operation UDTF
  6. 参考文档CREATE_FUNCTION 和 DROP_FUNCTION 为路径无关权限,只可以赋权给root,而READ_TIMESERIES可以赋权给root.test前缀,怀疑此问题是导致权限失效的原因;

Screenshots 下图为用户赋权对比: list privileges

下图为执行udf查询结果对比:

udf result

Desktop (please complete the following information):

  • OS: Amazon Linux

BraggingMan avatar Nov 03 '21 06:11 BraggingMan

Hi, this is your first issue in IoTDB project. Thanks for your report. Welcome to join the community!

github-actions[bot] avatar Nov 03 '21 06:11 github-actions[bot]