Pull request #644: Bugfix/RED-6265

Merge in RED/persistence-service from bugfix/RED-6265 to master

* commit '95f15cebd967d35a591e069b1b92e669de8c31b4':
  RED-6265 - Bulk dossier stats endpoint does not return dossier stats of dossiers, for which the current dossier does not have access permissions
  RED-6265 - Bulk dossier stats endpoint does not return dossier stats of dossiers, for which the current dossier does not have access permissions
This commit is contained in:
Corina Olariu 2023-03-28 18:53:17 +02:00
commit e3348698c0
3 changed files with 2 additions and 4 deletions

View File

@ -38,7 +38,7 @@ public class DossierStatsController implements DossierStatsResource {
@Override
@PreAuthorize("hasAuthority('" + READ_DOSSIER + "')")
@PreFilter("hasPermission(filterObject, 'Dossier', 'ACCESS_OBJECT')")
@PreFilter("hasPermission(filterObject, 'Dossier', 'VIEW_OBJECT')")
public List<DossierStats> getDossierStats(@RequestBody Set<String> dossierIds) {
return dossierIds.stream().map(dossierStatsService::getDossierStats).collect(Collectors.toList());

View File

@ -26,7 +26,6 @@ public interface DossierStatsResource {
String DOSSIER_ID_PATH_PARAM = "/{" + DOSSIER_ID_PARAM + "}";
@Deprecated
@ResponseBody
@ResponseStatus(value = HttpStatus.OK)
@GetMapping(value = DOSSIER_STATS_REST_PATH + DOSSIER_ID_PATH_PARAM, produces = MediaType.APPLICATION_JSON_VALUE)
@ -35,7 +34,6 @@ public interface DossierStatsResource {
DossierStats getDossierStats(@PathVariable(DOSSIER_ID_PARAM) String dossierId);
@Deprecated
@ResponseBody
@ResponseStatus(value = HttpStatus.OK)
@PostMapping(value = DOSSIER_STATS_REST_PATH, produces = MediaType.APPLICATION_JSON_VALUE)

View File

@ -35,7 +35,6 @@ import org.springframework.jdbc.datasource.SingleConnectionDataSource;
import org.springframework.stereotype.Service;
import com.iqser.red.keycloak.commons.KeyCloakAdminClientService;
import com.iqser.red.keycloak.commons.KeyCloakSettings;
import com.iqser.red.service.persistence.management.v1.processor.exception.ConflictException;
import com.iqser.red.service.persistence.management.v1.processor.exception.InternalServerErrorException;
import com.iqser.red.service.persistence.management.v1.processor.exception.NotFoundException;
@ -88,6 +87,7 @@ public class TenantManagementService {
private final KeyCloakRoleManagerService keyCloakRoleManagerService;
private final KeyCloakAdminClientService keycloak;
public TenantManagementService(EncryptionDecryptionService encryptionService,
@Qualifier("tenantLiquibaseProperties") LiquibaseProperties liquibaseProperties,
ResourceLoader resourceLoader,