Skip to content

Commit

Permalink
Merge pull request #2438 from atlanhq/PLT-294
Browse files Browse the repository at this point in the history
PLT-294 remove service users from guest role
  • Loading branch information
nikhilbonte21 authored Nov 1, 2023
2 parents 95f4361 + 6225339 commit 31f8fcc
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@

import static org.apache.atlas.keycloak.client.AtlasKeycloakClient.getKeycloakClient;
import static org.apache.atlas.repository.Constants.*;
import static org.apache.atlas.repository.util.AccessControlUtils.ARGO_SERVICE_USER_NAME;
import static org.apache.atlas.repository.util.AccessControlUtils.BACKEND_SERVICE_USER_NAME;


public class KeycloakUserStore {
Expand Down Expand Up @@ -257,6 +259,8 @@ private void processDefaultRole(Set<RangerRole> roleSet) {
apiTokenDefaultAccessRole.ifPresent(rangerRole -> nonGuestUsers.addAll(rangerRole.getUsers()));

defaultUsers.removeAll(nonGuestUsers);
defaultUsers.remove(new RangerRole.RoleMember(ARGO_SERVICE_USER_NAME, false));
defaultUsers.remove(new RangerRole.RoleMember(BACKEND_SERVICE_USER_NAME, false));

targetRole.get().getUsers().addAll(defaultUsers);
}
Expand Down

0 comments on commit 31f8fcc

Please sign in to comment.