koel/resources/assets/js/composables/useAuthorization.ts
2024-10-14 00:37:01 +07:00

12 lines
282 B
TypeScript

import { computed, toRef } from 'vue'
import { userStore } from '@/stores'
export const useAuthorization = () => {
const currentUser = toRef(userStore.state, 'current')
const isAdmin = computed(() => currentUser.value?.is_admin)
return {
currentUser,
isAdmin,
}
}