You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/12/30 15:28:46 UTC

[GitHub] [incubator-doris] morningman edited a comment on issue #7540: 行过滤和列脱敏[Feature]

morningman edited a comment on issue #7540:
URL: https://github.com/apache/incubator-doris/issues/7540#issuecomment-1003062824


   我认为这里可能需要三种权限:
   
   1. 行权限
   
       根据where条件赋予用户某些行的读。
       
       ```
       grant row_priv(where col>1 and abs(col2) < 3 or col3 =4) on db.tbl to user1
       ```
   
   2. 列权限
   
       赋予用户某些列的读取权限。
           
       ```
       grant column_priv(co1, col2, ...) on db.tbl to user1
       ```
       
   3. 数据脱敏
   
       通过函数对某列数据脱敏。
       
       ```
       grant mask_priv(col1 = id_masking(col1), col2 = id_masking(col2)) on db.tbl to user1;
       ```
       
   另外有一下这些事情需要考虑:
   
   1. 是否支持给同一个user,授予同一个表的多个同类型权限?比如
   
       ```
       grant row_priv(where col1>1) on db.tbl to user1;
       grant row_priv(where col2<3) on db.tbl to user1;
       ```
       
       如果支持,多个权限直接是 AND 关系还是 OR 的关系。并且如果需要 REVOKE 其中一个权限,如何指定?个人倾向于,不支持多个同类型权限。比如对于同一个user的同一张表,只有一个 row_priv,一个 colum_priv 和一个 mask_priv。如果重复授予,则后面的覆盖前面的。
       
       这样逻辑比较清晰,也简化了 revoke 的设计。
   
   2. 数据脱敏权限的作用范围
   
       比如先授予权限:
   
       ```
       grant mask_priv(col1 = id_masking(col1)) on db.tbl to user1;
       ```
   
       如果SQL 查询是:
   
       ```
       select col1 from tbl where col1 = 123;
       ```
   
       该如何改写?
   
   可以添加我的微信 morningman-cmy 做进一步探讨


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org