[Developer] #424 move sensitive column access to permissions

Refs #424
This commit is contained in:
devmrko
2026-06-23 13:37:43 +09:00
parent 55414aa9e4
commit b6fcc768a3
11 changed files with 719 additions and 20 deletions

View File

@@ -22,7 +22,12 @@
p.target_name AS object_name,
p.action_name AS action,
LISTAGG(pr.rule_type || NVL2(pr.rule_value, ':' || pr.rule_value, ''), ', ')
WITHIN GROUP (ORDER BY pr.rule_id) AS rules
WITHIN GROUP (ORDER BY pr.rule_id) AS rules,
(
SELECT LISTAGG(pc.column_name, ', ') WITHIN GROUP (ORDER BY pc.column_name)
FROM cb_permission_column pc
WHERE pc.permission_id = p.perm_id
) AS visible_columns
FROM cb_permission p
JOIN cb_app_role r ON r.role_id = p.role_id
LEFT JOIN cb_protected_object o ON o.object_name = p.target_name

View File

@@ -47,10 +47,7 @@
#{command.username},
#{command.empNo},
#{command.deptCode},
<choose>
<when test="command.canReadContents"> 'Y' </when>
<otherwise> 'N' </otherwise>
</choose>,
'N',
'Y'
)
</insert>

View File

@@ -40,6 +40,10 @@
규칙 값
<input class="form-control" name="ruleValue" placeholder="APAC 또는 HR">
</label>
<label>
표시 컬럼
<input class="form-control" name="visibleColumns" placeholder="CONTENTS">
</label>
<button class="btn btn-primary" type="submit">저장</button>
</form>
</section>
@@ -55,6 +59,7 @@
<th>테이블/뷰</th>
<th>Action</th>
<th>행 규칙</th>
<th>표시 컬럼</th>
<th></th>
</tr>
</thead>
@@ -65,6 +70,7 @@
<td th:text="${permission.objectName()}">CB_V_SEARCH_DOCUMENTS</td>
<td th:text="${permission.action()}">SELECT</td>
<td th:text="${permission.rules()} ?: '-'">ALL</td>
<td th:text="${permission.visibleColumns()} ?: '-'">CONTENTS</td>
<td>
<form method="post" action="/permissions/delete" class="inline-form">
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}">
@@ -74,7 +80,7 @@
</td>
</tr>
<tr th:if="${#lists.isEmpty(permissions)}">
<td colspan="6" class="text-muted">등록된 권한이 없습니다.</td>
<td colspan="7" class="text-muted">등록된 권한이 없습니다.</td>
</tr>
</tbody>
</table>

View File

@@ -27,10 +27,6 @@
부서코드
<input class="form-control" name="deptCode" required>
</label>
<label class="form-check form-switch switch-field">
<input class="form-check-input" name="canReadContents" type="checkbox" value="true">
<span class="form-check-label">민감 컬럼 표시</span>
</label>
<button class="btn btn-primary" type="submit">추가</button>
</form>
</section>
@@ -45,7 +41,6 @@
<th>사용자명</th>
<th>사번</th>
<th>부서</th>
<th>민감 컬럼</th>
<th>상태</th>
<th></th>
</tr>
@@ -56,7 +51,6 @@
<td th:text="${user.username()}">agent_hr</td>
<td th:text="${user.empNo()}">E10234</td>
<td th:text="${user.deptCode()}">HR</td>
<td><span class="badge" th:classappend="${user.canReadContents() == 'Y'} ? ' text-bg-success' : ' text-bg-secondary'" th:text="${user.canReadContents()}">N</span></td>
<td><span class="badge" th:classappend="${user.active()} ? ' text-bg-success' : ' text-bg-secondary'" th:text="${user.activeYn()}">Y</span></td>
<td>
<form method="post" action="/users/active" class="inline-form">
@@ -68,7 +62,7 @@
</td>
</tr>
<tr th:if="${#lists.isEmpty(users)}">
<td colspan="7" class="text-muted">등록된 사용자가 없습니다.</td>
<td colspan="6" class="text-muted">등록된 사용자가 없습니다.</td>
</tr>
</tbody>
</table>