22 lines
615 B
TypeScript
22 lines
615 B
TypeScript
/**
|
|
* Tenant-level admin (company logo, legal name, etc.).
|
|
* Wire to real roles/claims when auth exists. Until then:
|
|
* - localStorage `policy-ui.superadmin` = `1` | `0`
|
|
* - in dev, defaults to true when the key is unset so the org screen is reachable
|
|
*/
|
|
export function useSuperAdmin() {
|
|
const isSuperAdmin = computed(() => {
|
|
if (!import.meta.client) return false
|
|
try {
|
|
const v = localStorage.getItem('policy-ui.superadmin')
|
|
if (v === '1') return true
|
|
if (v === '0') return false
|
|
return import.meta.dev
|
|
} catch {
|
|
return false
|
|
}
|
|
})
|
|
|
|
return { isSuperAdmin }
|
|
}
|