fix #494: add delete impact confirmations

This commit is contained in:
devmrko
2026-06-26 14:33:25 +09:00
parent c8326f954d
commit cacf7b2bc4
13 changed files with 383 additions and 25 deletions

View File

@@ -12,6 +12,7 @@
<section th:replace="~{fragments/layout :: architectureStrip('permission')}"></section>
<div class="alert alert-success" th:if="${message}" th:text="${message}"></div>
<div class="alert alert-danger" th:if="${error}" th:text="${error}"></div>
<section class="content-band">
<div class="section-heading">
@@ -222,11 +223,13 @@
<th>행 규칙</th>
<th>적용 필터</th>
<th>원문 표시 허용 컬럼</th>
<th>삭제 영향</th>
<th></th>
</tr>
</thead>
<tbody>
<tr th:each="permission : ${permissions}">
<tr th:each="permission : ${permissions}"
th:with="lastPermission=${lastPermissionByPermissionId[permission.permissionId()]}">
<td th:text="${permission.permissionId()}">100</td>
<td th:text="${permission.roleName()}">HR_DEPT_ROLE</td>
<td th:text="${permission.objectName()}">CB_V_SEARCH_DOCUMENTS</td>
@@ -239,16 +242,26 @@
<td th:text="${permission.rules()} ?: '-'">ALL</td>
<td><pre class="table-pre" th:text="${permission.filterPreview()} ?: '-'">ALL ROWS</pre></td>
<td th:text="${permission.visibleColumns()} ?: '-'">CONTENTS</td>
<td class="delete-impact">
<span>역할이 이 TABLE/VIEW의 SELECT 권한을 잃습니다.</span>
<strong th:text="${permission.roleName() + ' -> ' + permission.objectName()}">ROLE -> OBJECT</strong>
<small th:if="${lastPermission}" class="text-danger">이 객체의 마지막 권한입니다. 삭제 후 보호 객체가 비활성화됩니다.</small>
<small th:unless="${lastPermission}">같은 객체에 다른 역할 권한이 남아 있습니다.</small>
</td>
<td>
<form method="post" action="/permissions/delete" class="inline-form">
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}">
<input type="hidden" name="permissionId" th:value="${permission.permissionId()}">
<label class="delete-confirm">
<input type="checkbox" name="confirmImpact" value="true" required>
영향 확인
</label>
<button class="btn btn-sm btn-outline-danger" type="submit">삭제</button>
</form>
</td>
</tr>
<tr th:if="${#lists.isEmpty(permissions)}">
<td colspan="9" class="text-muted">등록된 권한이 없습니다.</td>
<td colspan="10" class="text-muted">등록된 권한이 없습니다.</td>
</tr>
</tbody>
</table>