fix #477: use vpd targets in policy dropdowns
This commit is contained in:
@@ -2,7 +2,6 @@ package com.cloudhandson.vpdbackoffice.web;
|
||||
|
||||
import com.cloudhandson.vpdbackoffice.domain.vpd.VpdPolicyCreateCommand;
|
||||
import com.cloudhandson.vpdbackoffice.service.AppException;
|
||||
import com.cloudhandson.vpdbackoffice.service.ProtectedObjectService;
|
||||
import com.cloudhandson.vpdbackoffice.service.VpdPolicyService;
|
||||
import java.util.List;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
@@ -17,11 +16,9 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
public class VpdPolicyController {
|
||||
|
||||
private final VpdPolicyService vpdPolicyService;
|
||||
private final ProtectedObjectService protectedObjectService;
|
||||
|
||||
public VpdPolicyController(VpdPolicyService vpdPolicyService, ProtectedObjectService protectedObjectService) {
|
||||
public VpdPolicyController(VpdPolicyService vpdPolicyService) {
|
||||
this.vpdPolicyService = vpdPolicyService;
|
||||
this.protectedObjectService = protectedObjectService;
|
||||
}
|
||||
|
||||
@GetMapping("/vpd-policies")
|
||||
@@ -40,14 +37,12 @@ public class VpdPolicyController {
|
||||
try {
|
||||
model.addAttribute("policies", vpdPolicyService.findPolicies());
|
||||
model.addAttribute("vpdTargets", vpdPolicyService.findVpdTargets());
|
||||
model.addAttribute("objects", protectedObjectService.findEnabled());
|
||||
model.addAttribute("formOptions", vpdPolicyService.formOptions());
|
||||
} catch (DataAccessException exception) {
|
||||
RuntimeErrorMessage message = RuntimeErrorMessages.dataAccess(exception);
|
||||
model.addAttribute("runtimeError", message);
|
||||
model.addAttribute("policies", List.of());
|
||||
model.addAttribute("vpdTargets", List.of());
|
||||
model.addAttribute("objects", List.of());
|
||||
model.addAttribute("formOptions", vpdPolicyService.emptyFormOptions());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,9 +132,9 @@
|
||||
<label>
|
||||
VPD 적용 대상 TABLE/VIEW
|
||||
<select class="form-select" name="objectKey" required>
|
||||
<option th:each="object : ${objects}"
|
||||
th:value="${object.owner() + '.' + object.objectName()}"
|
||||
th:text="${object.displayName()}"></option>
|
||||
<option th:each="target : ${vpdTargets}"
|
||||
th:value="${target.objectDisplayName()}"
|
||||
th:text="${target.objectDisplayName() + ' / ' + target.objectType() + (target.vpdApplied() ? ' / VPD 적용됨' : ' / 미적용')}"></option>
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
|
||||
@@ -86,9 +86,9 @@
|
||||
<label>
|
||||
VPD 적용 대상 TABLE/VIEW
|
||||
<select class="form-select" name="objectKey" required>
|
||||
<option th:each="object : ${objects}"
|
||||
th:value="${object.owner() + '.' + object.objectName()}"
|
||||
th:text="${object.displayName()}"></option>
|
||||
<option th:each="target : ${vpdTargets}"
|
||||
th:value="${target.objectDisplayName()}"
|
||||
th:text="${target.objectDisplayName() + ' / ' + target.objectType() + (target.vpdApplied() ? ' / VPD 적용됨' : ' / 미적용')}"></option>
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
|
||||
Reference in New Issue
Block a user