NihalJain commented on code in PR #17295:
URL: https://github.com/apache/pinot/pull/17295#discussion_r2578027661


##########
pinot-spi/src/main/java/org/apache/pinot/spi/config/user/UserConfig.java:
##########
@@ -59,26 +61,72 @@ public class UserConfig extends BaseJsonConfig {
     @JsonPropertyDescription("The table permission of User")
     private List<AccessType> _permissions;
 
+    @JsonPropertyDescription("The RLS filters for User per table")
+    private Map<String, List<String>> _rlsFilters;
+
     @JsonCreator
     public UserConfig(@JsonProperty(value = USERNAME_KEY, required = true) 
String username,
         @JsonProperty(value = PASSWORD_KEY, required = true) String password,
         @JsonProperty(value = COMPONET_KEY, required = true) String component,
         @JsonProperty(value = ROLE_KEY, required = true) String role,
         @JsonProperty(value = TABLES_KEY) @Nullable List<String> tableList,
         @JsonProperty(value = EXCLUDE_TABLES_KEY) @Nullable List<String> 
excludeTableList,
-        @JsonProperty(value = PERMISSIONS_KEY) @Nullable List<AccessType> 
permissionList
+        @JsonProperty(value = PERMISSIONS_KEY) @Nullable List<AccessType> 
permissionList,
+        @JsonProperty(value = RLS_FILTERS_KEY) @Nullable Map<String, 
List<String>> rlsFilters
     ) {
-        Preconditions.checkArgument(username != null, "'username' must be 
configured");
-        Preconditions.checkArgument(password != null, "'password' must be 
configured");
+        this(username, password, component, role, tableList, excludeTableList, 
permissionList, rlsFilters, true);
+    }
+
+    /**
+     * Constructor for backward compatibility without RLS filters.
+     * This allows existing code to continue working without modification.
+     */
+    public UserConfig(String username, String password, String component, 
String role,
+        List<String> tableList, List<String> excludeTableList, 
List<AccessType> permissionList) {
+        this(username, password, component, role, tableList, excludeTableList, 
permissionList, null, true);
+    }
+
+    private UserConfig(String username, String password, String component, 
String role,
+        List<String> tableList, List<String> excludeTableList, 
List<AccessType> permissionList,
+        Map<String, List<String>> rlsFilters, boolean validate) {
+        if (validate) {

Review Comment:
   cant recall why i added this flag, drop?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to