mirror of
https://github.com/koel/koel
synced 2024-12-24 11:33:05 +00:00
9 lines
271 B
TypeScript
9 lines
271 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 }
|
|
}
|