WIP jordan
This commit is contained in:
21
app/composables/useSuperAdmin.ts
Normal file
21
app/composables/useSuperAdmin.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* 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 }
|
||||
}
|
||||
Reference in New Issue
Block a user