ClickHouse/ClickHouse

Select asterisk from table with only several column granted not throw an exception

开放

#41,671 创建于 2022年9月22日

 (4 条评论) (0 个反应) (0 位负责人)C++ (8,400 个派生)batch import
comp-rbacfeaturehelp wantedminorwarmup task

仓库指标

星标
 (47,419 个星标)
PR 合并指标
 (平均合并 2天 2小时) (30 天内合并 1,000 个 PR)

描述

Currently, if i add grant to user for select one column of table and this user will execute select * from table, user will get Not enough privileges. Is it possible to add functionality, like if user have grant for 1 column and he will select *, he will get only one column, but not exception? Example (curretly behavior):

create user test_user;

create table test_table(
    id Int64,
    value String
) engine MergeTree order by id;

GRANT SELECT(id) ON test_table TO test_user;

--login as test_user
select * from test_table limit 100; --get exeption Not enough privileges

Example (my suggestion):

create user test_user;

create table test_table(
    id Int64,
    value String
) engine MergeTree order by id;

GRANT SELECT(id) ON test_table TO test_user;

--login as test_user
select * from test_table limit 100; --will return column only one id column

贡献者指南