mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
fixing the role filtering api issues
This commit is contained in:
parent
e205fd97cd
commit
cda0dd417f
@ -181,7 +181,7 @@ public interface RoleManagementService {
|
||||
@QueryParam("limit") int limit);
|
||||
|
||||
@GET
|
||||
@Path("/roles/filter/{prefix}")
|
||||
@Path("/filter/{prefix}")
|
||||
@ApiOperation(
|
||||
produces = MediaType.APPLICATION_JSON,
|
||||
httpMethod = "GET",
|
||||
|
||||
@ -88,6 +88,8 @@ public class RoleManagementServiceImpl implements RoleManagementService {
|
||||
}
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/filter/{prefix}")
|
||||
@Override
|
||||
public Response getFilteredRoles(
|
||||
@PathParam("prefix") String prefix,
|
||||
@ -109,7 +111,6 @@ public class RoleManagementServiceImpl implements RoleManagementService {
|
||||
//Get the total role count that matches the given filter
|
||||
List<String> filteredRoles = getRolesFromUserStore(filter, userStore);
|
||||
finalRoleList = new ArrayList<String>();
|
||||
targetRoles.setCount(filteredRoles.size());
|
||||
|
||||
filteredRoles = FilteringUtil.getFilteredList(getRolesFromUserStore(filter, userStore), offset, limit);
|
||||
for (String rolename : filteredRoles){
|
||||
@ -117,6 +118,7 @@ public class RoleManagementServiceImpl implements RoleManagementService {
|
||||
finalRoleList.add(rolename);
|
||||
}
|
||||
}
|
||||
targetRoles.setCount(finalRoleList.size());
|
||||
targetRoles.setList(finalRoleList);
|
||||
|
||||
return Response.ok().entity(targetRoles).build();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user