Files
sam-manage/resources/views/permission-analyze/partials/trace-result.blade.php
hskwon 1fc530bca2 feat(mng): 권한 분석 페이지 구현
- 메뉴별 권한 분석 기능 (접근 가능/불가 사용자 목록)
- 사용자 역추적 기능 (역할/부서/개인별 권한 추적)
- CSV 내보내기 기능
- 트리 구조 시각화 (└─ 연결선, 폴더/문서 아이콘)
- 중복 메뉴 표시 문제 해결 (테넌트별 메뉴만 표시)
2025-11-26 21:42:51 +09:00

163 lines
8.2 KiB
PHP

<!-- 역추적 결과 -->
<div class="space-y-6">
<!-- 역할로 권한 부여된 사용자 -->
<div>
<h3 class="text-sm font-semibold text-gray-800 mb-3 flex items-center gap-2">
<span class="inline-flex items-center justify-center w-6 h-6 bg-purple-100 text-purple-800 rounded-full text-xs font-bold">
{{ count($trace['by_role'] ?? []) }}
</span>
역할로 권한 부여된 사용자
</h3>
@if(count($trace['by_role'] ?? []) > 0)
<div class="overflow-x-auto">
<table class="w-full text-sm border border-gray-200 rounded-lg">
<thead class="bg-purple-50">
<tr>
<th class="px-4 py-2 text-left font-medium text-gray-700">사용자</th>
<th class="px-4 py-2 text-left font-medium text-gray-700">역할</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200">
@foreach($trace['by_role'] as $item)
<tr class="hover:bg-gray-50">
<td class="px-4 py-2">
<div class="font-medium text-gray-900">{{ $item['user_name'] }}</div>
<div class="text-xs text-gray-500">{{ $item['email'] }}</div>
</td>
<td class="px-4 py-2">
<span class="inline-flex items-center px-2 py-0.5 text-xs font-medium bg-purple-100 text-purple-800 rounded">
{{ $item['role']['display_name'] ?? $item['role']['name'] }}
</span>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@else
<div class="text-center py-4 text-gray-500 bg-gray-50 rounded-lg">
<p class="text-sm">역할로 권한 부여된 사용자가 없습니다.</p>
</div>
@endif
</div>
<!-- 부서로 권한 부여된 사용자 -->
<div>
<h3 class="text-sm font-semibold text-gray-800 mb-3 flex items-center gap-2">
<span class="inline-flex items-center justify-center w-6 h-6 bg-blue-100 text-blue-800 rounded-full text-xs font-bold">
{{ count($trace['by_department'] ?? []) }}
</span>
부서로 권한 부여된 사용자
</h3>
@if(count($trace['by_department'] ?? []) > 0)
<div class="overflow-x-auto">
<table class="w-full text-sm border border-gray-200 rounded-lg">
<thead class="bg-blue-50">
<tr>
<th class="px-4 py-2 text-left font-medium text-gray-700">사용자</th>
<th class="px-4 py-2 text-left font-medium text-gray-700">부서</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200">
@foreach($trace['by_department'] as $item)
<tr class="hover:bg-gray-50">
<td class="px-4 py-2">
<div class="font-medium text-gray-900">{{ $item['user_name'] }}</div>
<div class="text-xs text-gray-500">{{ $item['email'] }}</div>
</td>
<td class="px-4 py-2">
<span class="inline-flex items-center px-2 py-0.5 text-xs font-medium bg-blue-100 text-blue-800 rounded">
{{ $item['department']['name'] }}
@if($item['department']['code'])
<span class="ml-1 text-blue-600">({{ $item['department']['code'] }})</span>
@endif
</span>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@else
<div class="text-center py-4 text-gray-500 bg-gray-50 rounded-lg">
<p class="text-sm">부서로 권한 부여된 사용자가 없습니다.</p>
</div>
@endif
</div>
<!-- 개인 ALLOW로 권한 부여된 사용자 -->
<div>
<h3 class="text-sm font-semibold text-gray-800 mb-3 flex items-center gap-2">
<span class="inline-flex items-center justify-center w-6 h-6 bg-green-100 text-green-800 rounded-full text-xs font-bold">
{{ count($trace['by_personal'] ?? []) }}
</span>
개인 ALLOW로 권한 부여된 사용자
</h3>
@if(count($trace['by_personal'] ?? []) > 0)
<div class="overflow-x-auto">
<table class="w-full text-sm border border-gray-200 rounded-lg">
<thead class="bg-green-50">
<tr>
<th class="px-4 py-2 text-left font-medium text-gray-700">사용자</th>
<th class="px-4 py-2 text-left font-medium text-gray-700">이메일</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200">
@foreach($trace['by_personal'] as $item)
<tr class="hover:bg-gray-50">
<td class="px-4 py-2">
<div class="font-medium text-gray-900">{{ $item['user_name'] }}</div>
</td>
<td class="px-4 py-2">
<div class="text-gray-500">{{ $item['email'] }}</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@else
<div class="text-center py-4 text-gray-500 bg-gray-50 rounded-lg">
<p class="text-sm">개인 ALLOW로 권한 부여된 사용자가 없습니다.</p>
</div>
@endif
</div>
<!-- 개인 DENY로 거부된 사용자 -->
<div>
<h3 class="text-sm font-semibold text-gray-800 mb-3 flex items-center gap-2">
<span class="inline-flex items-center justify-center w-6 h-6 bg-red-100 text-red-800 rounded-full text-xs font-bold">
{{ count($trace['denied_users'] ?? []) }}
</span>
개인 DENY로 거부된 사용자
</h3>
@if(count($trace['denied_users'] ?? []) > 0)
<div class="overflow-x-auto">
<table class="w-full text-sm border border-gray-200 rounded-lg">
<thead class="bg-red-50">
<tr>
<th class="px-4 py-2 text-left font-medium text-gray-700">사용자</th>
<th class="px-4 py-2 text-left font-medium text-gray-700">이메일</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200">
@foreach($trace['denied_users'] as $item)
<tr class="hover:bg-gray-50">
<td class="px-4 py-2">
<div class="font-medium text-gray-900">{{ $item['user_name'] }}</div>
</td>
<td class="px-4 py-2">
<div class="text-gray-500">{{ $item['email'] }}</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@else
<div class="text-center py-4 text-gray-500 bg-gray-50 rounded-lg">
<p class="text-sm">개인 DENY로 거부된 사용자가 없습니다.</p>
</div>
@endif
</div>
</div>