Skip to content

Commit

Permalink
Merge pull request #584 from mpmadhavig/rolecount-issue
Browse files Browse the repository at this point in the history
Get role count for a filter in a given tenant
  • Loading branch information
mpmadhavig authored Dec 11, 2024
2 parents af6e5f2 + 9d181e1 commit c902cf9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -472,16 +472,22 @@ private RolesV2GetResponse filterRolesByAttributes(Node node, Integer count, Int
LOG.debug(String.format("Filtering roles from search filter: %s", searchFilter));
}
List<Role> roles;
int roleCount;
List<RoleV2> 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<RoleV2> scimRoles = getScimRolesList(roles, requiredAttributes);
return new RolesV2GetResponse(scimRoles.size(), scimRoles);
return new RolesV2GetResponse(roleCount, scimRoles);
}

private String buildSearchFilter(Node node) throws BadRequestException {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
<inbound.auth.oauth.version>6.5.3</inbound.auth.oauth.version>
<commons-collections.version>3.2.0.wso2v1</commons-collections.version>
<carbon.kernel.version>4.10.24</carbon.kernel.version>
<identity.framework.version>7.7.15</identity.framework.version>
<identity.framework.version>7.7.26</identity.framework.version>
<junit.version>4.13.1</junit.version>
<commons.lang.version>20030203.000129</commons.lang.version>
<identity.governance.version>1.8.12</identity.governance.version>
Expand Down

0 comments on commit c902cf9

Please sign in to comment.