diff --git a/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMRoleManagerV2.java b/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMRoleManagerV2.java index 7ebb2ff39..1a9996303 100644 --- a/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMRoleManagerV2.java +++ b/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMRoleManagerV2.java @@ -472,16 +472,22 @@ private RolesV2GetResponse filterRolesByAttributes(Node node, Integer count, Int LOG.debug(String.format("Filtering roles from search filter: %s", searchFilter)); } List roles; + int roleCount; + List scimRoles; try { roles = roleManagementService.getRoles(searchFilter, count, startIndex, sortBy, sortOrder, tenantDomain, requiredAttributes); + scimRoles = getScimRolesList(roles, requiredAttributes); + roleCount = roleManagementService.getRolesCount(searchFilter, tenantDomain); + if (roleCount == 0) { + roleCount = scimRoles.size(); + } } catch (IdentityRoleManagementException e) { throw new CharonException( String.format("Error occurred while listing roles based on the search filter: %s", searchFilter), e); } - List scimRoles = getScimRolesList(roles, requiredAttributes); - return new RolesV2GetResponse(scimRoles.size(), scimRoles); + return new RolesV2GetResponse(roleCount, scimRoles); } private String buildSearchFilter(Node node) throws BadRequestException { diff --git a/pom.xml b/pom.xml index a0a4cda87..af9aeafe8 100644 --- a/pom.xml +++ b/pom.xml @@ -294,7 +294,7 @@ 6.5.3 3.2.0.wso2v1 4.10.24 - 7.7.15 + 7.7.26 4.13.1 20030203.000129 1.8.12