MIFOSX-750: earlier fix was incorrect and messed up paging results.
This commit is contained in:
+1
-1
@@ -13,5 +13,5 @@ public interface PlatformSecurityContext {
|
||||
|
||||
void validateAccessRights(String resourceOfficeHierarchy);
|
||||
|
||||
String officeHierarcy();
|
||||
String OfficeHierarchy();
|
||||
}
|
||||
+1
-1
@@ -48,7 +48,7 @@ public class SpringSecurityPlatformSecurityContext implements PlatformSecurityCo
|
||||
}
|
||||
|
||||
@Override
|
||||
public String officeHierarcy() {
|
||||
public String OfficeHierarchy() {
|
||||
return authenticatedUser().getOffice().getHierarchy();
|
||||
}
|
||||
}
|
||||
|
||||
+7
-7
@@ -93,13 +93,13 @@ public class ClientReadPlatformServiceImpl implements ClientReadPlatformService
|
||||
@Override
|
||||
public Page<ClientData> retrieveAll(final SearchParameters searchParameters) {
|
||||
|
||||
final String hierarchy = this.context.officeHierarcy();
|
||||
String hierarchySearchString = hierarchy + "%";
|
||||
final String userOfficeHierarchy = this.context.OfficeHierarchy();
|
||||
final String underHierarchySearchString = userOfficeHierarchy + "%";
|
||||
|
||||
if (searchParameters.isScopedByOfficeHierarchy()) {
|
||||
this.context.validateAccessRights(searchParameters.getHierarchy());
|
||||
hierarchySearchString = searchParameters.getHierarchy();
|
||||
}
|
||||
// if (searchParameters.isScopedByOfficeHierarchy()) {
|
||||
// this.context.validateAccessRights(searchParameters.getHierarchy());
|
||||
// underHierarchySearchString = searchParameters.getHierarchy() + "%";
|
||||
// }
|
||||
|
||||
final StringBuilder sqlBuilder = new StringBuilder(200);
|
||||
sqlBuilder.append("select SQL_CALC_FOUND_ROWS ");
|
||||
@@ -129,7 +129,7 @@ public class ClientReadPlatformServiceImpl implements ClientReadPlatformService
|
||||
|
||||
final String sqlCountRows = "SELECT FOUND_ROWS()";
|
||||
return this.paginationHelper.fetchPage(this.jdbcTemplate, sqlCountRows, sqlBuilder.toString(), new Object[] {
|
||||
hierarchySearchString, hierarchySearchString }, this.clientMapper);
|
||||
underHierarchySearchString, underHierarchySearchString }, this.clientMapper);
|
||||
}
|
||||
|
||||
private String buildSqlStringFromClientCriteria(final SearchParameters searchParameters) {
|
||||
|
||||
Reference in New Issue
Block a user