Skip to content

Commit

Permalink
MOSIP-37258
Browse files Browse the repository at this point in the history
Signed-off-by: Jayesh Kharode <[email protected]>
  • Loading branch information
Jayesh Kharode committed Nov 7, 2024
1 parent 4db2638 commit 0cc4287
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ public static String getproperty(String key) {
public static String getRolesForUser(String userId) {
return getproperty("roles." + userId);
}

public static String getRolesForUser() {
return getproperty("roles");
}

public static String getServerErrorsToMonitor() { return getproperty("serverErrorsToMonitor"); }
public static String getEnableDebug() { return getproperty("enableDebug"); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ public static void createUsers(String userid, String pwd, String rolenum, Map<St

List<RoleRepresentation> allRoles = realmResource.roles().list();
List<RoleRepresentation> availableRoles = new ArrayList<>();
List<String> toBeAssignedRoles = List.of(propsKernel.getProperty(rolenum).split(","));
List<String> toBeAssignedRoles = List.of(ConfigManager.getRolesForUser().split(","));
for (String role : toBeAssignedRoles) {
if (allRoles.stream().anyMatch((r -> r.getName().equalsIgnoreCase(role)))) {
if (allRoles.stream().filter(r->r.getName().equals(role)).findFirst().isPresent())
Expand Down

0 comments on commit 0cc4287

Please sign in to comment.