[v0.12.4]用户与角色UDF权限赋予问题,非root用户查询返回空值时,报错"Msg: 602: No permissions for this operation UDTF"
- Lingua principale
- Java
- Stelle
- 6.4k
- Fork
- 1.2k
- Merge medio
- 1g 23h
- PR unite (30g)
- 115
Descrizione
**Describe the bug**
iotdb 0.12.4修复了0.12.2版本中用户与角色UDF权限赋予非root无法正确生效的问题,可参考[Issue-4308](https://github.com/apache/iotdb/issues/4308)。但是当我们使用非root用户进行UDF查询时,如果查询的值不存在,依然报错"Msg: 602: No permissions for this operation UDTF"。这会给用户误导。希望可以在新版本中修复。
**To Reproduce**
Steps to reproduce the behavior:
1. 使用root用户登录sbin/start-cli.sh -h 127.0.0.1 -p 6667 -u root -pw root
2. 创建非root用户并赋权:
CREATE ROLE udtf_test 'udtf_passwd'
CREATE ROLE udtf_test_role
GRANT ROLE udtf_test_role PRIVILEGES 'SET_STORAGE_GROUP','CREATE_TIMESERIES','INSERT_TIMESERIES','READ_TIMESERIES','DELETE_TIMESERIES','DROP_FUNCTION','CREATE_FUNCTION' ON root.test
GRANT udtf_test_role TO udtf_test
3. 使用root用户查询:
select WTUR_PwrAt_Ra_F32 from root.test.20.123456789 where time >= 2021-01-01 and time<= 2021-01-31 23:59:59
+----+
|Time|
+----+
+----+
4. 使用udtf_test用户查询:Msg: 602: No permissions for this operation UDTF。
5. 执行命令,导入数据:
insert into root.test.20.123456789(time, WTUR_PwrAt_Ra_F32) values(1,1)
6. root用户和用户分别使用相同命令查询,得到相同的结果如下:
select WTUR_PwrAt_Ra_F32 from root.test.20.123456789 where time >= 2021-01-01 and time<= 2021-01-31 23:59:59
+----+-----------------------------------------+
|Time|root.test.20.123456789.WTUR_PwrAt_Ra_F32|
+----+-----------------------------------------+
+----+-----------------------------------------+
**Expected behavior**
非root用户查询空表格时,应正确返回空值,而非报权限错误,这会使用户产生误解。
Desktop (please complete the following information):
OS: Amazon Linux
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Riproduci il report con sbin/start-cli.sh usando le concessioni di ruolo e la query UDF fornite, prima con una tabella vuota e poi dopo aver inserito i dati. Leggi Issue-4308 per la gestione correlata delle autorizzazioni e traccia il percorso di autorizzazione di UDF. Il lavoro è completato quando un utente non-root autorizzato riceve un risultato vuoto, non un errore di autorizzazione fuorviante.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java, sql
- Ambito
- authorization, databases, security
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100