RED-9145: remove EXPERIMENTAL role which no user has #531

Merged
kilian.schuettler1 merged 1 commits from RED-9145 into master 2024-06-07 10:44:53 +02:00
2 changed files with 7 additions and 16 deletions

View File

@ -1,6 +1,5 @@
package com.iqser.red.persistence.service.v2.external.api.impl.controller;
import static com.iqser.red.service.persistence.management.v1.processor.roles.ActionRoles.EXPERIMENTAL;
import static com.iqser.red.service.persistence.management.v1.processor.roles.ActionRoles.GET_REPORT_TEMPLATES;
import static com.iqser.red.service.persistence.management.v1.processor.roles.ActionRoles.READ_DOSSIER_ATTRIBUTES_CONFIG;
import static com.iqser.red.service.persistence.management.v1.processor.roles.ActionRoles.READ_DOSSIER_STATUS;
@ -115,13 +114,12 @@ public class DossierTemplateControllerV2 implements DossierTemplateResource {
}
@PreAuthorize("hasAuthority('" + WRITE_RULES + "') and hasAuthority('" + EXPERIMENTAL + "')")
@PreAuthorize("hasAuthority('" + WRITE_RULES + "')")
public ResponseEntity<DroolsValidationResponse> uploadEntityRules(@PathVariable(DOSSIER_TEMPLATE_ID_PARAM) String dossierTemplateId,
@Schema(type = "string", format = "binary", name = "file") @RequestPart(name = "file") MultipartFile file,
@Parameter(name = DRY_RUN_PARAM, description = "If true rules will be only validated not stored.") @RequestParam(value = DRY_RUN_PARAM, required = false, defaultValue = "false") boolean dryRun) {
// Try to get dossier template to return 404 if it does not exist
getDossierTemplate(dossierTemplateId);
dossierTemplatePersistenceService.checkDossierTemplateExistsOrElseThrow404(dossierTemplateId);
return uploadRules(dossierTemplateId, RuleFileType.ENTITY, file, dryRun);
}
@ -130,20 +128,18 @@ public class DossierTemplateControllerV2 implements DossierTemplateResource {
@PreAuthorize("hasAuthority('" + READ_RULES + "')")
public ResponseEntity<?> downloadEntityRules(@PathVariable(DOSSIER_TEMPLATE_ID_PARAM) String dossierTemplateId) {
// Try to get dossier template to return 404 if it does not exist
getDossierTemplate(dossierTemplateId);
dossierTemplatePersistenceService.checkDossierTemplateExistsOrElseThrow404(dossierTemplateId);
return downloadRules(dossierTemplateId, RuleFileType.ENTITY);
}
@PreAuthorize("hasAuthority('" + WRITE_RULES + "') and hasAuthority('" + EXPERIMENTAL + "')")
@PreAuthorize("hasAuthority('" + WRITE_RULES + "')")
public ResponseEntity<DroolsValidationResponse> uploadComponentRules(@PathVariable(DOSSIER_TEMPLATE_ID_PARAM) String dossierTemplateId,
@Schema(type = "string", format = "binary", name = "file") @RequestPart(name = "file") MultipartFile file,
@Parameter(name = DRY_RUN_PARAM, description = "If true rules will be only validated not stored.") @RequestParam(value = DRY_RUN_PARAM, required = false, defaultValue = "false") boolean dryRun) {
// Try to get dossier template to return 404 if it does not exist
getDossierTemplate(dossierTemplateId);
dossierTemplatePersistenceService.checkDossierTemplateExistsOrElseThrow404(dossierTemplateId);
return uploadRules(dossierTemplateId, RuleFileType.COMPONENT, file, dryRun);
}
@ -152,8 +148,7 @@ public class DossierTemplateControllerV2 implements DossierTemplateResource {
@PreAuthorize("hasAuthority('" + READ_RULES + "')")
public ResponseEntity<?> downloadComponentRules(@PathVariable(DOSSIER_TEMPLATE_ID_PARAM) String dossierTemplateId) {
// Try to get dossier template to return 404 if it does not exist
getDossierTemplate(dossierTemplateId);
dossierTemplatePersistenceService.checkDossierTemplateExistsOrElseThrow404(dossierTemplateId);
return downloadRules(dossierTemplateId, RuleFileType.COMPONENT);
}
@ -162,8 +157,7 @@ public class DossierTemplateControllerV2 implements DossierTemplateResource {
@PreAuthorize("hasAuthority('" + READ_FILE_ATTRIBUTES_CONFIG + "')")
public FileAttributeDefinitionList getFileAttributeDefinitions(@PathVariable(DOSSIER_TEMPLATE_ID_PARAM) String dossierTemplateId) {
// Try to get dossier template to return 404 if it does not exist
getDossierTemplate(dossierTemplateId);
dossierTemplatePersistenceService.checkDossierTemplateExistsOrElseThrow404(dossierTemplateId);
var fileAttributeConfigs = fileAttributesController.getFileAttributesConfiguration(dossierTemplateId);

View File

@ -2,9 +2,6 @@ package com.iqser.red.service.persistence.management.v1.processor.roles;
public final class ActionRoles {
// Experimental
public static final String EXPERIMENTAL = "red-experimental";
// Audit
public static final String SEARCH_AUDIT_LOG = "red-search-audit-log";