qzsee commented on code in PR #38301:
URL: https://github.com/apache/doris/pull/38301#discussion_r1699751511


##########
fe/fe-core/src/main/java/org/apache/doris/policy/PolicyMgr.java:
##########
@@ -379,6 +389,40 @@ public RowPolicy getMatchTablePolicy(String ctlName, 
String dbName, String table
         return mergeRowPolicies(res);
     }
 
+    public DorisDataMaskPolicy getDataMaskPolicy(String ctlName, String 
dbName, String tableName, String colName, UserIdentity user) {
+        if (!hasDataMaskPolicy(ctlName, dbName, tableName, colName)) {
+            return null;
+        }
+        readLock();
+        try {
+            if (!hasDataMaskPolicy(ctlName, dbName, tableName, colName)) {
+                return null;
+            }
+            List<DorisDataMaskPolicy> dorisDataMaskPolicies = 
dataMaskPolicies.get(ctlName).get(dbName).get(tableName)
+                    .get(colName);
+            Set<String> roles = 
Env.getCurrentEnv().getAccessManager().getAuth().getRolesByUserWithLdap(user).stream()
+                    .map(role -> 
ClusterNamespace.getNameFromFullName(role.getRoleName())).collect(Collectors.toSet());
+
+            for (DorisDataMaskPolicy dataMaskPolicy : dorisDataMaskPolicies) {
+                if ((dataMaskPolicy.getUser() != null && 
dataMaskPolicy.getUser().getQualifiedUser()

Review Comment:
   Yes, there is a priority issue, which is not considered here, but only one 
piece of data is returned.



-- 
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

Reply via email to