incubator-doris [Bug] grant DROP_PRIV permision on tables to user, but user can drop database

fquxozlt  于 2022-04-22  发布在  Java
关注(0)|答案(0)|浏览(144)

Search before asking

  • I had searched in the issues and found no similar issues.

Version

0.15

What's Wrong?

grant DROP_PRIV on test_db.* to dev@'%';

For example, run sql above, user 'dev' can not only drop any table on database 'test_db', but also drop database 'test_db'.

What You Expected?

grant DROP_PRIV on test_db.* to dev@'%';

When I ran the sql above, user 'dev' can drop any table on database 'test_db', but it can't drop database 'test_db'.

How to Reproduce?

-- create database and table
create database test_db; use test_db; create table test_table_01( id int, name varchar(20) ) ENGINE=OLAP COMMENT "comment for test_table" DISTRIBUTED BY HASH(id) BUCKETS 10 PROPERTIES ( "replication_allocation" = "tag.location.default: 3", "in_memory" = "false", "storage_format" = "V2" );

-- create user and grant permision
create user dev@'%' identified by 'dev'; grant DROP_PRIV on test_db.* to dev@'%';

-- drop table by user 'dev': succeeded
use test_db; drop table test_table_01;
-- drop database by user 'dev': also succeeded
drop database test_db;

Anything Else?

  • No response*

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题