refactor(tools): change content of tools

This commit is contained in:
riefive
2025-09-08 13:50:38 +07:00
parent 56389263ae
commit 8a4b4c06e9
3 changed files with 3 additions and 44 deletions
@@ -1,41 +0,0 @@
<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: 'Tambah User',
contentFrame: 'cf-full-width',
})
const route = useRoute()
useHead({
title: () => route.meta.title as string,
})
const roleAccess: PagePermission = PAGE_PERMISSIONS['/doctor']
const { checkRole, hasCreateAccess } = useRBAC()
// Check if user has access to this page
const hasAccess = checkRole(roleAccess)
if (!hasAccess) {
throw createError({
statusCode: 403,
statusMessage: 'Access denied',
})
}
// Define permission-based computed properties
const canCreate = hasCreateAccess(roleAccess)
</script>
<template>
<div v-if="canCreate">
<FlowDeviceEntry />
</div>
<Error v-else :status-code="403" />
</template>
@@ -27,13 +27,13 @@ if (!hasAccess) {
}
// Define permission-based computed properties
const canRead = hasReadAccess(roleAccess)
const canRead = true // hasReadAccess(roleAccess)
</script>
<template>
<div>
<div v-if="canRead">
<FlowDeviceList />
<ContentToolsList />
</div>
<Error v-else :status-code="403" />
</div>
+1 -1
View File
@@ -187,7 +187,7 @@
{
"title": "Peralatan",
"icon": "i-lucide-tools",
"link": "/tools-equipment-src/device"
"link": "/tools-equipment-src/tools"
},
{
"title": "Perlengkapan (BMHP)",