Skip to content

Commit

Permalink
fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
AnuradhaSK committed Oct 23, 2023
1 parent 765da8f commit 6195bac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
import org.wso2.carbon.identity.organization.management.service.OrganizationManager;
import org.wso2.carbon.identity.organization.management.service.exception.OrganizationManagementClientException;
import org.wso2.carbon.identity.organization.management.service.exception.OrganizationManagementException;
import org.wso2.carbon.identity.role.v2.mgt.core.IdentityRoleManagementException;
import org.wso2.carbon.identity.role.v2.mgt.core.RoleManagementService;
import org.wso2.carbon.identity.role.v2.mgt.core.exception.IdentityRoleManagementException;

import java.util.Arrays;
import java.util.List;
Expand Down Expand Up @@ -238,10 +238,12 @@ private AssociatedRolesConfig getAssociatedRolesConfigForSharedApp(
throws IdentityRoleManagementException {

String allowedAudience = associatedRolesConfigOfMainApp.getAllowedAudience();
List<RoleV2> mainAppRoles = associatedRolesConfigOfMainApp.getRoles();
RoleV2[] mainAppRoles = associatedRolesConfigOfMainApp.getRoles();
List<RoleV2> mainappRoleList = Arrays.asList(mainAppRoles);
AssociatedRolesConfig associatedRolesConfigForSharedApp = new AssociatedRolesConfig();
associatedRolesConfigForSharedApp.setAllowedAudience(allowedAudience);
List<String> mainAppRoleIds = mainAppRoles.stream().map(RoleV2::getId).collect(Collectors.toList());
List<String> mainAppRoleIds =
mainappRoleList.stream().map(RoleV2::getId).collect(Collectors.toList());
Map<String, String> mainRoleToSharedRoleMappingsBySubOrg =
getRoleManagementServiceV2().getMainRoleToSharedRoleMappingsBySubOrg(mainAppRoleIds,
tenantDomainOfSharedApp);
Expand All @@ -252,7 +254,7 @@ private AssociatedRolesConfig getAssociatedRolesConfigForSharedApp(
String mainRoleId = entry.getKey();

// Find the main role by ID and retrieve its name.
String mainRoleName = mainAppRoles.stream()
String mainRoleName = mainappRoleList.stream()
.filter(role -> role.getId().equals(mainRoleId))
.findFirst()
.map(RoleV2::getName)
Expand All @@ -265,7 +267,7 @@ private AssociatedRolesConfig getAssociatedRolesConfigForSharedApp(
})
.collect(Collectors.toList());

associatedRolesConfigForSharedApp.setRoles(associatedRolesOfSharedApp);
associatedRolesConfigForSharedApp.setRoles(associatedRolesOfSharedApp.toArray(new RoleV2[0]));
return associatedRolesConfigForSharedApp;
}

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@
<carbon.multitenancy.package.import.version.range>[4.7.0,5.0.0)
</carbon.multitenancy.package.import.version.range>

<carbon.identity.framework.version>5.25.400</carbon.identity.framework.version>
<carbon.identity.framework.version>5.25.424-SNAPSHOT</carbon.identity.framework.version>
<carbon.identity.package.import.version.range>[5.20.0, 7.0.0)
</carbon.identity.package.import.version.range>

Expand Down

0 comments on commit 6195bac

Please sign in to comment.