feat: add create permission handling in TreeComponent and MainPage
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 5s
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 5s
This commit is contained in:
parent
5e155cfb0c
commit
4a195494d6
3 changed files with 26 additions and 19 deletions
|
|
@ -1074,6 +1074,7 @@ watch(currentHq, () => {
|
|||
<div class="col full-width scroll">
|
||||
<div class="q-pa-md">
|
||||
<TreeComponent
|
||||
:hide-create="!canAccess('branch', 'create')"
|
||||
v-model:nodes="treeData"
|
||||
v-model:expanded-tree="expandedTree"
|
||||
node-key="id"
|
||||
|
|
@ -1562,17 +1563,17 @@ watch(currentHq, () => {
|
|||
<q-td>
|
||||
<KebabAction
|
||||
v-if="
|
||||
isRoleInclude([
|
||||
'system',
|
||||
'head_of_admin',
|
||||
'admin',
|
||||
'executive',
|
||||
'accountant',
|
||||
]) ||
|
||||
(canAccess('branch') && currentHq.id)
|
||||
!currentHq.id
|
||||
? canAccess('branch', 'create')
|
||||
: true
|
||||
"
|
||||
:status="props.row.status"
|
||||
:idName="props.row.name"
|
||||
:hide-delete="
|
||||
!currentHq.id
|
||||
? !isRoleInclude(['system'])
|
||||
: !canAccess('branch', 'create')
|
||||
"
|
||||
@view="
|
||||
if (props.row.isHeadOffice) {
|
||||
triggerEdit(
|
||||
|
|
@ -1713,17 +1714,17 @@ watch(currentHq, () => {
|
|||
<template v-slot:action>
|
||||
<KebabAction
|
||||
v-if="
|
||||
isRoleInclude([
|
||||
'system',
|
||||
'head_of_admin',
|
||||
'admin',
|
||||
'executive',
|
||||
'accountant',
|
||||
]) ||
|
||||
(canAccess('branch') && currentHq.id)
|
||||
!currentHq.id
|
||||
? canAccess('branch', 'create')
|
||||
: true
|
||||
"
|
||||
:status="props.row.status"
|
||||
:idName="props.row.name"
|
||||
:hide-delete="
|
||||
!currentHq.id
|
||||
? !isRoleInclude(['system'])
|
||||
: !canAccess('branch', 'create')
|
||||
"
|
||||
@view="
|
||||
if (props.row.isHeadOffice) {
|
||||
triggerEdit(
|
||||
|
|
@ -2272,7 +2273,11 @@ watch(currentHq, () => {
|
|||
type="button"
|
||||
/>
|
||||
<DeleteButton
|
||||
v-if="formType !== 'edit'"
|
||||
v-if="
|
||||
formType !== 'edit' && formTypeBranch === 'headOffice'
|
||||
? isRoleInclude(['system'])
|
||||
: canAccess('branch', 'create')
|
||||
"
|
||||
id="btn-info-basic-delete"
|
||||
icon-only
|
||||
@click="triggerDelete(currentEdit.id)"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue