stalary commented on code in PR #9206: URL: https://github.com/apache/incubator-doris/pull/9206#discussion_r860315095
########## docs/zh-CN/administrator-guide/policy/row-policy.md: ########## @@ -0,0 +1,60 @@ +--- +{ +"title": "行安全策略", +"language": "zh-CN" +} +--- + +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +# 行安全策略 + +该功能用于配置行级权限,在 sql 执行时添加对应拦截条件,通过 explain 可以看到改写后的过滤条件: + +## 语句 + +目前支持对行策略的创建/删除/查询 + +创建 +```sql +CREATE [ROW] POLICY [IF NOT EXISTS] test_row_policy +ON test_table # 作用的表 +AS {PERMISSIVE|RESTRICTIVE} # 关联条件,以最后一次创建的为准 +TO admin # 绑定的用户 +USING (a = ’xxx‘) # 拦截语句 +``` +- PERMISSIVE: 宽松条件,多条策略通过 OR 连接 +- RESTRICTIVE:限制条件,多条策略通过 AND 连接 + +创建示例 +```sql +CREATE POLICY test_row_policy_1 ON test.table1 AS RESTRICTIVE TO root USING (id in (1, 2)); +``` + +删除 +```sql +DROP POLICY test_row_policy_1 on table1; Review Comment: I will supplement it -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org