45 lines
1.1 KiB
Vue
45 lines
1.1 KiB
Vue
<script setup lang="ts">
|
|
import type { PagePermission } from '~/models/role'
|
|
import Error from '~/components/pub/base/error/error.vue'
|
|
import { PAGE_PERMISSIONS } from '~/lib/page-permission'
|
|
|
|
definePageMeta({
|
|
middleware: ['rbac'],
|
|
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
|
|
title: 'Daftar User',
|
|
contentFrame: 'cf-full-width',
|
|
})
|
|
|
|
const route = useRoute()
|
|
|
|
useHead({
|
|
title: () => route.meta.title as string,
|
|
})
|
|
|
|
const roleAccess: PagePermission = PAGE_PERMISSIONS['/doctor']
|
|
|
|
const { checkRole, hasReadAccess } = useRBAC()
|
|
|
|
// Check if user has access to this page
|
|
const hasAccess = checkRole(roleAccess)
|
|
if (!hasAccess) {
|
|
navigateTo('/403')
|
|
}
|
|
|
|
// Define permission-based computed properties
|
|
const canRead = true // hasReadAccess(roleAccess)
|
|
</script>
|
|
|
|
<template>
|
|
<div>
|
|
<div v-if="canRead">
|
|
<<<<<<< HEAD:app/pages/(features)/tools-equipment-src/tools/index.vue
|
|
<ContentToolsList />
|
|
=======
|
|
<ContentDeviceList />
|
|
>>>>>>> 266d5f740b15942ca7b8845c00573640fdc9a3b2:app/pages/(features)/tools-equipment-src/device/index.vue
|
|
</div>
|
|
<Error v-else :status-code="403" />
|
|
</div>
|
|
</template>
|