koel/resources/assets/js/composables/useAuthorization.ts

13 lines
281 B
TypeScript
Raw Normal View History

import { computed, toRef } from 'vue'
import { userStore } from '@/stores'
export const useAuthorization = () => {
const currentUser = toRef(userStore.state, 'current')
2022-05-15 15:25:02 +00:00
const isAdmin = computed(() => currentUser.value?.is_admin)
return {
currentUser,
isAdmin
}
}