Skip to content

Commit

Permalink
Add basic connector access control classes and fformat code
Browse files Browse the repository at this point in the history
Signed-off-by: zane-neo <zaniu@amazon.com>
  • Loading branch information
zane-neo committed Jul 10, 2023
1 parent ef0747e commit b9c4036
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ private boolean isUserHasBackendRole(User user, Connector connector) {
AccessMode modelAccessMode = connector.getAccess();
return AccessMode.RESTRICTED == modelAccessMode
&& (user.getBackendRoles() != null
&& connector.getBackendRoles() != null
&& connector.getBackendRoles().stream().anyMatch(x -> user.getBackendRoles().contains(x)));
&& connector.getBackendRoles() != null
&& connector.getBackendRoles().stream().anyMatch(x -> user.getBackendRoles().contains(x)));
}

private boolean previouslyPublicConnector(Connector connector) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@

package org.opensearch.ml.settings;

import com.google.common.collect.ImmutableList;
import org.opensearch.common.settings.Setting;

import java.util.List;
import java.util.function.Function;

import org.opensearch.common.settings.Setting;

import com.google.common.collect.ImmutableList;

public final class MLCommonsSettings {

private MLCommonsSettings() {}
Expand Down

0 comments on commit b9c4036

Please sign in to comment.