소유자 관리자 진입 권한 보강
This commit is contained in:
@@ -8,6 +8,15 @@ const member = ref(null)
|
||||
|
||||
const { data: siteSettings } = await usePublicSiteSettings()
|
||||
|
||||
/**
|
||||
* 현재 회원이 공개 헤더에서 관리자 화면으로 이동할 수 있는지 확인한다.
|
||||
* @returns {boolean} 관리자 화면 이동 가능 여부
|
||||
*/
|
||||
const canOpenSiteAdmin = computed(() => {
|
||||
const role = String(member.value?.role || '').toLowerCase()
|
||||
return Boolean(member.value?.isAdmin) || role === 'owner' || role === 'admin'
|
||||
})
|
||||
|
||||
/**
|
||||
* 사용자 메뉴를 닫는다.
|
||||
* @returns {void}
|
||||
@@ -267,7 +276,7 @@ onBeforeUnmount(() => {
|
||||
</div>
|
||||
|
||||
<template v-if="member">
|
||||
<NuxtLink v-if="member?.isAdmin" class="site-header__user-link flex items-center gap-1.5 rounded-[8px] px-2.5 py-1.5 transition-colors duration-150 hover:bg-[var(--site-panel)]" to="/admin" @click="closeUserMenu">
|
||||
<NuxtLink v-if="canOpenSiteAdmin" class="site-header__user-link flex items-center gap-1.5 rounded-[8px] px-2.5 py-1.5 transition-colors duration-150 hover:bg-[var(--site-panel)]" to="/admin" @click="closeUserMenu">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor" class="h-5 w-5" aria-hidden="true">
|
||||
<path d="M160-120q-33 0-56.5-23.5T80-200v-480q0-33 23.5-56.5T160-760h240l80 80h320q33 0 56.5 23.5T880-600v400q0 33-23.5 56.5T800-120H160Zm0-80h640v-400H447l-80-80H160v480Zm280-80h80v-120h120v-80H520v-120h-80v120H320v80h120v120ZM160-200v-480 480Z" />
|
||||
</svg>
|
||||
|
||||
Reference in New Issue
Block a user