|
|
@@ -184,16 +184,8 @@ public class KeycloakServiceImpl implements KeycloakService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public String getUserTenant(String userId) {
|
|
|
- List<GroupRepresentation> groups = keycloak.realm(realm).users().get(userId).groups();
|
|
|
- if (groups.isEmpty()) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- String path = groups.get(0).getPath();
|
|
|
- if (path.lastIndexOf('/') == 0) {
|
|
|
- return path;
|
|
|
- }
|
|
|
- return path.substring(0, path.indexOf('/', 1));
|
|
|
+ public List<String> getUserGroupPathList(String userId) {
|
|
|
+ return keycloak.realm(realm).users().get(userId).groups().stream().map(GroupRepresentation::getPath).collect(Collectors.toList());
|
|
|
}
|
|
|
|
|
|
private List<KeycloakUserCO> getUserByRoleAndGroup(String group, String role) {
|