fix #477: remove vpd apply actions from filter policy page

This commit is contained in:
devmrko
2026-06-26 09:11:20 +09:00
parent 74fbd9a2b2
commit 3c9bcfdc0a
2 changed files with 2 additions and 195 deletions

View File

@@ -80,24 +80,6 @@ public class VpdPolicyController {
return "redirect:/vpd-policies"; return "redirect:/vpd-policies";
} }
@PostMapping("/vpd-filter-policies")
public String createFilterPolicy(
@RequestParam String objectKey,
@RequestParam String policyName,
@RequestParam(required = false) String functionKey,
@RequestParam(required = false) String functionOwner,
@RequestParam(required = false) String functionName,
@RequestParam(defaultValue = "SELECT") List<String> statementTypes,
@RequestParam(defaultValue = "false") boolean enabled,
@RequestParam(defaultValue = "false") boolean updateCheck,
@RequestParam(required = false) String filterPredicate,
RedirectAttributes redirectAttributes
) {
createPolicyInternal(objectKey, policyName, functionKey, functionOwner, functionName, statementTypes, enabled,
updateCheck, filterPredicate, redirectAttributes);
return "redirect:/vpd-filter-policies";
}
@PostMapping("/vpd-filter-policies/filters") @PostMapping("/vpd-filter-policies/filters")
public String saveFilter( public String saveFilter(
@RequestParam(required = false) String functionOwner, @RequestParam(required = false) String functionOwner,
@@ -216,25 +198,6 @@ public class VpdPolicyController {
return "redirect:/vpd-policies"; return "redirect:/vpd-policies";
} }
@PostMapping("/vpd-filter-policies/bulk")
public String bulkApplyFilterPolicy(
@RequestParam String schemaOwner,
@RequestParam(defaultValue = "false") boolean includeTables,
@RequestParam(defaultValue = "false") boolean includeViews,
@RequestParam(required = false) String functionKey,
@RequestParam(required = false) String functionOwner,
@RequestParam(required = false) String functionName,
@RequestParam(defaultValue = "SELECT") List<String> statementTypes,
@RequestParam(defaultValue = "false") boolean enabled,
@RequestParam(defaultValue = "false") boolean updateCheck,
@RequestParam(required = false) String filterPredicate,
RedirectAttributes redirectAttributes
) {
bulkApplyPolicyInternal(schemaOwner, includeTables, includeViews, functionKey, functionOwner, functionName,
statementTypes, enabled, updateCheck, filterPredicate, redirectAttributes);
return "redirect:/vpd-filter-policies";
}
private void bulkApplyPolicyInternal( private void bulkApplyPolicyInternal(
String schemaOwner, String schemaOwner,
boolean includeTables, boolean includeTables,

View File

@@ -6,7 +6,7 @@
<main class="container py-4"> <main class="container py-4">
<div class="page-title"> <div class="page-title">
<h1>Filter Policy 관리</h1> <h1>Filter Policy 관리</h1>
<p>Filter를 관리하고, VPD policy를 개별 객체 또는 스키마 단위로 적용합니다.</p> <p>Filter function과 적용된 VPD policy를 관리합니다. TABLE/VIEW 개별/벌크 적용은 VPD 설정에서 처리합니다.</p>
</div> </div>
<div class="alert alert-warning" th:if="${runtimeError}"> <div class="alert alert-warning" th:if="${runtimeError}">
@@ -16,32 +16,10 @@
<div class="alert alert-success" th:if="${successMessage}" th:text="${successMessage}">등록되었습니다.</div> <div class="alert alert-success" th:if="${successMessage}" th:text="${successMessage}">등록되었습니다.</div>
<div class="alert alert-danger" th:if="${errorMessage}" th:text="${errorMessage}">처리할 수 없습니다.</div> <div class="alert alert-danger" th:if="${errorMessage}" th:text="${errorMessage}">처리할 수 없습니다.</div>
<section class="content-band">
<div class="section-heading">
<div>
<h2>VPD 적용 대상 Schema</h2>
<p class="section-subtitle">개별 적용 드롭다운에 표시할 TABLE/VIEW 스키마를 선택하거나 직접 입력합니다.</p>
</div>
<span class="badge text-bg-secondary" th:text="${#lists.size(vpdTargets)}">0</span>
</div>
<form method="get" action="/vpd-filter-policies" class="inline-form">
<label>
Schema
<input class="form-control form-control-sm" name="schemaOwner" list="filter-schema-owner-options"
th:value="${selectedSchemaOwner}" placeholder="관리 대상 스키마 또는 직접 입력">
</label>
<button class="btn btn-sm rw-btn-secondary" type="submit">조회</button>
</form>
<datalist id="filter-schema-owner-options">
<option value="">관리 대상 스키마</option>
<option th:each="owner : ${formOptions.schemaOwners()}" th:value="${owner}"></option>
</datalist>
</section>
<section class="content-band"> <section class="content-band">
<div class="section-heading"> <div class="section-heading">
<h2>Filter 등록/수정</h2> <h2>Filter 등록/수정</h2>
<a class="btn btn-sm rw-btn-secondary" href="/vpd-policies">적용 현황 보기</a> <a class="btn btn-sm rw-btn-secondary" href="/vpd-policies">VPD 적용 화면</a>
</div> </div>
<form method="post" action="/vpd-filter-policies/filters" class="form-grid"> <form method="post" action="/vpd-filter-policies/filters" class="form-grid">
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"> <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}">
@@ -145,89 +123,6 @@
</div> </div>
</section> </section>
<section class="content-band">
<div class="section-heading">
<h2>VPD 개별 적용</h2>
</div>
<form method="post" action="/vpd-filter-policies" class="form-grid">
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}">
<label>
VPD 적용 대상 TABLE/VIEW
<select class="form-select" name="objectKey" required>
<option th:each="target : ${vpdTargets}"
th:value="${target.objectDisplayName()}"
th:text="${target.objectDisplayName() + ' / ' + target.objectType() + (target.vpdApplied() ? ' / VPD 적용됨' : ' / 미적용')}"></option>
</select>
</label>
<label>
Policy 이름
<select class="form-select" name="policyName" required>
<option th:each="policyName : ${formOptions.policyNames()}"
th:value="${policyName}"
th:text="${policyName}"></option>
</select>
</label>
<label class="span-2">
VPD Filter Function
<select class="form-select" name="functionKey">
<option value="">기본 권한 함수가 없으면 Filter predicate로 새 function 자동 생성</option>
<option th:each="function : ${formOptions.functions()}"
th:value="${function.value()}"
th:text="${function.functionName() == 'CB_AGENT_DOC_VPD_FILTER' ? function.label() + ' / 기본 권한 테이블 필터' : function.label()}"
th:selected="${function.value() == formOptions.defaultPermissionFunctionKey()}"></option>
</select>
</label>
<label>
Function Owner
<select class="form-select" name="functionOwner">
<option value="">현재 연결 사용자</option>
<option th:each="owner : ${formOptions.owners()}"
th:value="${owner}"
th:text="${owner}"></option>
</select>
</label>
<label>
Function 이름
<select class="form-select" name="functionName">
<option value="">POLICY_NAME_FILTER 자동 생성</option>
<option th:each="function : ${formOptions.functions()}"
th:value="${function.functionName()}"
th:text="${function.functionName()}"></option>
</select>
</label>
<div>
Statement Types
<div class="checkbox-row">
<label class="form-check" th:each="statement : ${formOptions.statementTypes()}">
<input class="form-check-input" type="checkbox" name="statementTypes"
th:value="${statement}" th:checked="${statement == 'SELECT'}">
<span class="form-check-label" th:text="${statement}">SELECT</span>
</label>
</div>
</div>
<div class="form-check align-self-end">
<input class="form-check-input" id="filter-enabled" type="checkbox" name="enabled" value="true" checked>
<label class="form-check-label" for="filter-enabled">등록 즉시 활성화</label>
</div>
<div class="form-check span-2">
<input class="form-check-input" id="filter-update-check" type="checkbox" name="updateCheck" value="true">
<label class="form-check-label" for="filter-update-check">INSERT/UPDATE에도 predicate check 적용</label>
</div>
<label class="span-2">
Filter predicate
<textarea class="form-control" id="filter-predicate" name="filterPredicate" rows="4"
placeholder="예: dept_code = SYS_CONTEXT(''CB_AGENT_CTX'', ''DEPT_CODE'')&#10;비우면 기존 Function 이름으로 ADD_POLICY만 실행합니다."></textarea>
</label>
<div class="question-presets span-2" aria-label="Filter predicate 예시">
<button class="btn rw-btn-secondary question-preset" type="button" data-target="filter-predicate" data-question="1=0">전체 차단</button>
<button class="btn rw-btn-secondary question-preset" type="button" data-target="filter-predicate" data-question="1=1">전체 허용</button>
<button class="btn rw-btn-secondary question-preset" type="button" data-target="filter-predicate" data-question="dept_code = SYS_CONTEXT('CB_AGENT_CTX', 'DEPT_CODE')">부서 일치</button>
<button class="btn rw-btn-secondary question-preset" type="button" data-target="filter-predicate" data-question="owner_emp_no = SYS_CONTEXT('CB_AGENT_CTX', 'EMP_NO')">본인 소유</button>
</div>
<button class="btn rw-btn-primary" type="submit">개별 객체에 VPD 적용</button>
</form>
</section>
<section class="content-band"> <section class="content-band">
<div class="section-heading"> <div class="section-heading">
<h2>적용된 Policy 목록/수정</h2> <h2>적용된 Policy 목록/수정</h2>
@@ -277,57 +172,6 @@
</div> </div>
</section> </section>
<section class="content-band">
<div class="section-heading">
<h2>VPD 벌크 적용</h2>
</div>
<form method="post" action="/vpd-filter-policies/bulk" class="form-grid">
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}">
<label>
Schema
<select class="form-select" name="schemaOwner" required>
<option th:each="owner : ${formOptions.schemaOwners()}" th:value="${owner}" th:text="${owner}"></option>
</select>
</label>
<div>
Object Types
<div class="checkbox-row">
<label class="form-check"><input class="form-check-input" type="checkbox" name="includeTables" value="true" checked><span class="form-check-label">TABLE</span></label>
<label class="form-check"><input class="form-check-input" type="checkbox" name="includeViews" value="true" checked><span class="form-check-label">VIEW</span></label>
</div>
</div>
<label class="span-2">
VPD Filter Function
<select class="form-select" name="functionKey">
<option value="">기본 권한 함수가 없으면 Filter predicate로 벌크 function 자동 생성</option>
<option th:each="function : ${formOptions.functions()}"
th:value="${function.value()}"
th:text="${function.functionName() == 'CB_AGENT_DOC_VPD_FILTER' ? function.label() + ' / 기본 권한 테이블 필터' : function.label()}"
th:selected="${function.value() == formOptions.defaultPermissionFunctionKey()}"></option>
</select>
</label>
<div>
Statement Types
<div class="checkbox-row">
<label class="form-check" th:each="statement : ${formOptions.statementTypes()}">
<input class="form-check-input" type="checkbox" name="statementTypes"
th:value="${statement}" th:checked="${statement == 'SELECT'}">
<span class="form-check-label" th:text="${statement}">SELECT</span>
</label>
</div>
</div>
<div class="form-check align-self-end">
<input class="form-check-input" id="bulk-filter-enabled" type="checkbox" name="enabled" value="true" checked>
<label class="form-check-label" for="bulk-filter-enabled">등록 즉시 활성화</label>
</div>
<label class="span-2">
Filter predicate
<textarea class="form-control" id="bulk-filter-predicate" name="filterPredicate" rows="4"
placeholder="기존 Function을 선택하지 않으면 이 predicate로 스키마 공통 function을 생성합니다."></textarea>
</label>
<button class="btn rw-btn-primary" type="submit">스키마 TABLE/VIEW에 VPD 일괄 적용</button>
</form>
</section>
</main> </main>
<script> <script>
document.querySelectorAll('.question-preset').forEach((button) => { document.querySelectorAll('.question-preset').forEach((button) => {