Skip to content

Commit

Permalink
Improve shared role creation in sub organization level
Browse files Browse the repository at this point in the history
  • Loading branch information
ShanChathusanda93 committed Oct 25, 2024
1 parent 2333d0d commit f10580d
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,12 @@ private void createSharedRolesOnNewRoleCreation(Map<String, Object> eventPropert
for (BasicOrganization organization : applicationSharedOrganizations) {
String shareAppTenantDomain =
getOrganizationManager().resolveTenantDomain(organization.getId());
RoleBasicInfo sharedRoleInfo = getRoleManagementServiceV2().addRole(mainRoleName,
String sharedOrgRoleName = mainRoleName;

Check warning on line 274 in components/org.wso2.carbon.identity.organization.management.handler/src/main/java/org/wso2/carbon/identity/organization/management/handler/SharedRoleMgtHandler.java

View check run for this annotation

Codecov / codecov/patch

components/org.wso2.carbon.identity.organization.management.handler/src/main/java/org/wso2/carbon/identity/organization/management/handler/SharedRoleMgtHandler.java#L274

Added line #L274 was not covered by tests
if (getRoleManagementServiceV2().isExistingRoleName(mainRoleName, RoleConstants.ORGANIZATION,
organization.getId(), shareAppTenantDomain)) {
sharedOrgRoleName = mainRoleName + "_shared_to_" + shareAppTenantDomain;

Check warning on line 277 in components/org.wso2.carbon.identity.organization.management.handler/src/main/java/org/wso2/carbon/identity/organization/management/handler/SharedRoleMgtHandler.java

View check run for this annotation

Codecov / codecov/patch

components/org.wso2.carbon.identity.organization.management.handler/src/main/java/org/wso2/carbon/identity/organization/management/handler/SharedRoleMgtHandler.java#L276-L277

Added lines #L276 - L277 were not covered by tests
}
RoleBasicInfo sharedRoleInfo = getRoleManagementServiceV2().addRole(sharedOrgRoleName,

Check warning on line 279 in components/org.wso2.carbon.identity.organization.management.handler/src/main/java/org/wso2/carbon/identity/organization/management/handler/SharedRoleMgtHandler.java

View check run for this annotation

Codecov / codecov/patch

components/org.wso2.carbon.identity.organization.management.handler/src/main/java/org/wso2/carbon/identity/organization/management/handler/SharedRoleMgtHandler.java#L279

Added line #L279 was not covered by tests
Collections.emptyList(),
Collections.emptyList(),
Collections.emptyList(), RoleConstants.ORGANIZATION, organization.getId(),
Expand Down

0 comments on commit f10580d

Please sign in to comment.