Merge branch 'RED-9145' into 'master'

RED-9145: remove EXPERIMENTAL role which no user has

Closes RED-9145

See merge request redactmanager/persistence-service!531
This commit is contained in:
Kilian Schüttler 2024-06-07 10:44:53 +02:00
commit 2ef9800eae
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; 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.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_ATTRIBUTES_CONFIG;
import static com.iqser.red.service.persistence.management.v1.processor.roles.ActionRoles.READ_DOSSIER_STATUS; 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, public ResponseEntity<DroolsValidationResponse> uploadEntityRules(@PathVariable(DOSSIER_TEMPLATE_ID_PARAM) String dossierTemplateId,
@Schema(type = "string", format = "binary", name = "file") @RequestPart(name = "file") MultipartFile file, @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) { @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 dossierTemplatePersistenceService.checkDossierTemplateExistsOrElseThrow404(dossierTemplateId);
getDossierTemplate(dossierTemplateId);
return uploadRules(dossierTemplateId, RuleFileType.ENTITY, file, dryRun); return uploadRules(dossierTemplateId, RuleFileType.ENTITY, file, dryRun);
} }
@ -130,20 +128,18 @@ public class DossierTemplateControllerV2 implements DossierTemplateResource {
@PreAuthorize("hasAuthority('" + READ_RULES + "')") @PreAuthorize("hasAuthority('" + READ_RULES + "')")
public ResponseEntity<?> downloadEntityRules(@PathVariable(DOSSIER_TEMPLATE_ID_PARAM) String dossierTemplateId) { public ResponseEntity<?> downloadEntityRules(@PathVariable(DOSSIER_TEMPLATE_ID_PARAM) String dossierTemplateId) {
// Try to get dossier template to return 404 if it does not exist dossierTemplatePersistenceService.checkDossierTemplateExistsOrElseThrow404(dossierTemplateId);
getDossierTemplate(dossierTemplateId);
return downloadRules(dossierTemplateId, RuleFileType.ENTITY); 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, public ResponseEntity<DroolsValidationResponse> uploadComponentRules(@PathVariable(DOSSIER_TEMPLATE_ID_PARAM) String dossierTemplateId,
@Schema(type = "string", format = "binary", name = "file") @RequestPart(name = "file") MultipartFile file, @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) { @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 dossierTemplatePersistenceService.checkDossierTemplateExistsOrElseThrow404(dossierTemplateId);
getDossierTemplate(dossierTemplateId);
return uploadRules(dossierTemplateId, RuleFileType.COMPONENT, file, dryRun); return uploadRules(dossierTemplateId, RuleFileType.COMPONENT, file, dryRun);
} }
@ -152,8 +148,7 @@ public class DossierTemplateControllerV2 implements DossierTemplateResource {
@PreAuthorize("hasAuthority('" + READ_RULES + "')") @PreAuthorize("hasAuthority('" + READ_RULES + "')")
public ResponseEntity<?> downloadComponentRules(@PathVariable(DOSSIER_TEMPLATE_ID_PARAM) String dossierTemplateId) { public ResponseEntity<?> downloadComponentRules(@PathVariable(DOSSIER_TEMPLATE_ID_PARAM) String dossierTemplateId) {
// Try to get dossier template to return 404 if it does not exist dossierTemplatePersistenceService.checkDossierTemplateExistsOrElseThrow404(dossierTemplateId);
getDossierTemplate(dossierTemplateId);
return downloadRules(dossierTemplateId, RuleFileType.COMPONENT); return downloadRules(dossierTemplateId, RuleFileType.COMPONENT);
} }
@ -162,8 +157,7 @@ public class DossierTemplateControllerV2 implements DossierTemplateResource {
@PreAuthorize("hasAuthority('" + READ_FILE_ATTRIBUTES_CONFIG + "')") @PreAuthorize("hasAuthority('" + READ_FILE_ATTRIBUTES_CONFIG + "')")
public FileAttributeDefinitionList getFileAttributeDefinitions(@PathVariable(DOSSIER_TEMPLATE_ID_PARAM) String dossierTemplateId) { public FileAttributeDefinitionList getFileAttributeDefinitions(@PathVariable(DOSSIER_TEMPLATE_ID_PARAM) String dossierTemplateId) {
// Try to get dossier template to return 404 if it does not exist dossierTemplatePersistenceService.checkDossierTemplateExistsOrElseThrow404(dossierTemplateId);
getDossierTemplate(dossierTemplateId);
var fileAttributeConfigs = fileAttributesController.getFileAttributesConfiguration(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 { public final class ActionRoles {
// Experimental
public static final String EXPERIMENTAL = "red-experimental";
// Audit // Audit
public static final String SEARCH_AUDIT_LOG = "red-search-audit-log"; public static final String SEARCH_AUDIT_LOG = "red-search-audit-log";