Fix: 메뉴 구조 개선 및 관리자 권한 수정

- 프로필 관리 vs 계정 관리 구분 명확화:
  - 프로필 관리: 개인 계정 설정 (모든 사용자)
  - 계정 관리: 전체 사용자 관리 (관리자만)
- 관리자 메뉴 디버깅 로그 추가
- admin@test.com 계정을 관리자로 업데이트
- 아이콘 변경: users → users-cog (계정 관리)
This commit is contained in:
Hyungi Ahn
2025-09-03 17:59:10 +09:00
parent 43e2614253
commit 0833b99e6f
2 changed files with 16 additions and 4 deletions

View File

@@ -177,8 +177,8 @@
<!-- 메뉴 항목들 -->
<div class="py-1">
<a href="profile.html" class="flex items-center px-4 py-2 text-sm text-gray-700 hover:bg-gray-50">
<i class="fas fa-user-cog w-4 h-4 mr-3 text-gray-400"></i>
계정 설정
<i class="fas fa-user-edit w-4 h-4 mr-3 text-gray-400"></i>
프로필 관리
</a>
<!-- 관리자 메뉴 (관리자만 표시) -->
@@ -188,8 +188,8 @@
<div class="text-xs font-medium text-gray-500 uppercase tracking-wide">관리자</div>
</div>
<a href="user-management.html" class="flex items-center px-4 py-2 text-sm text-gray-700 hover:bg-gray-50">
<i class="fas fa-users w-4 h-4 mr-3 text-indigo-500"></i>
사용자 관리
<i class="fas fa-users-cog w-4 h-4 mr-3 text-indigo-500"></i>
계정 관리
</a>
<a href="system-settings.html" class="flex items-center px-4 py-2 text-sm text-gray-700 hover:bg-gray-50">
<i class="fas fa-server w-4 h-4 mr-3 text-green-500"></i>

View File

@@ -195,12 +195,24 @@ document.addEventListener('headerLoaded', () => {
if (dropdownUserRole) dropdownUserRole.textContent = roleText;
// 관리자 메뉴 표시/숨김
console.log('🔍 사용자 권한 확인:', {
role: user.role,
is_admin: user.is_admin,
can_manage_books: user.can_manage_books,
can_manage_notes: user.can_manage_notes,
can_manage_novels: user.can_manage_novels
});
if (adminMenuSection) {
if (user.role === 'root' || user.role === 'admin' || user.is_admin) {
console.log('✅ 관리자 메뉴 표시');
adminMenuSection.classList.remove('hidden');
} else {
console.log('❌ 관리자 메뉴 숨김');
adminMenuSection.classList.add('hidden');
}
} else {
console.log('❌ adminMenuSection 요소를 찾을 수 없음');
}
} else {
// 로그아웃된 상태