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

@@ -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 {
// 로그아웃된 상태