morningman commented on code in PR #34392:
URL: https://github.com/apache/doris/pull/34392#discussion_r1590297988


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/authorizer/ranger/RangerAccessController.java:
##########
@@ -135,12 +135,27 @@ public Optional<DataMaskPolicy> 
evalDataMaskPolicy(UserIdentity currentUser, Str
         if (StringUtils.isEmpty(maskType)) {
             return Optional.empty();
         }
-        String transformer = policy.getMaskTypeDef().getTransformer();
-        if (StringUtils.isEmpty(transformer)) {
-            return Optional.empty();
+        switch (maskType) {
+            case "MASK_NULL":
+                return Optional.of(new RangerDataMaskPolicy(currentUser, ctl, 
db, tbl, col, policy.getPolicyId(),
+                        policy.getPolicyVersion(), maskType, "NULL"));
+            case "MASK_NONE":
+                return Optional.empty();
+            case "CUSTOM":
+                String maskedValue = policy.getMaskedValue();
+                if (StringUtils.isEmpty(maskedValue)) {
+                    return Optional.empty();
+                }
+                return Optional.of(new RangerDataMaskPolicy(currentUser, ctl, 
db, tbl, col, policy.getPolicyId(),
+                        policy.getPolicyVersion(), maskType, 
maskedValue.replace("{col}", col)));
+            default:
+                String transformer = policy.getMaskTypeDef().getTransformer();

Review Comment:
   Yes



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