Skip to content

feat: Add rule for role (#23823)#23851

Open
ouyuanning wants to merge 13 commits intomatrixorigin:3.0-devfrom
ouyuanning:cp-23823-to-3.0-dev
Open

feat: Add rule for role (#23823)#23851
ouyuanning wants to merge 13 commits intomatrixorigin:3.0-devfrom
ouyuanning:cp-23823-to-3.0-dev

Conversation

@ouyuanning
Copy link
Contributor

@ouyuanning ouyuanning commented Mar 16, 2026

增加面向角色的改写规则
新增语法
ALTER ROLE role_name ADD RULE "SELECT * FROM hint_test.users WHERE age > 28" ON TABLE hint_test.users (ON TABLE 后面是真实的库表名)
ALTER ROLE role_name REMOVE RULE ON TABLE hint_test.users

新增元数据表
create table mo_catalog.mo_role_rule(role_id int unsign, rule_name varchar(200 rule varchar(500), primary key(role_id, rule_name));

Approved by: @iamlinjunhong, @heni02, @XuPeng-SH, @LeftHandCold, @fengttt

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #23271

What this PR does / why we need it:

增加面向角色的改写规则,以满足MOI行列权限的需求

增加面向角色的改写规则
新增语法
ALTER ROLE  role_name ADD RULE "SELECT * FROM hint_test.users WHERE age > 28" ON TABLE hint_test.users
(ON TABLE 后面是真实的库表名)
ALTER ROLE role_name REMOVE RULE ON TABLE hint_test.users

新增元数据表
create table mo_catalog.mo_role_rule(role_id int unsign,  rule_name varchar(200  rule varchar(500), primary key(role_id, rule_name));

Approved by: @iamlinjunhong, @heni02, @XuPeng-SH, @LeftHandCold, @fengttt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature size/XXL Denotes a PR that changes 2000+ lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants