refactor: enhance role-based access checks in TreeComponent and MainPage components
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 6s
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 6s
This commit is contained in:
parent
8799799214
commit
701b90d89a
2 changed files with 29 additions and 3 deletions
|
|
@ -123,7 +123,13 @@ defineEmits<{
|
|||
v-if="
|
||||
node.isHeadOffice &&
|
||||
typeTree === 'branch' &&
|
||||
isRoleInclude(['head_of_admin', 'admin', 'system'])
|
||||
isRoleInclude([
|
||||
'system',
|
||||
'head_of_admin',
|
||||
'admin',
|
||||
'executive',
|
||||
'accountant',
|
||||
])
|
||||
"
|
||||
:id="`create-sub-branch-btn-${node.name}`"
|
||||
@click.stop="$emit('create', node)"
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import type { QTableProps, QTableSlots } from 'quasar';
|
|||
import { resetScrollBar } from 'src/stores/utils';
|
||||
import useBranchStore from 'stores/branch';
|
||||
import useFlowStore from 'stores/flow';
|
||||
import { isRoleInclude } from 'stores/utils';
|
||||
import { isRoleInclude, canAccess } from 'stores/utils';
|
||||
import {
|
||||
BranchWithChildren,
|
||||
BranchCreate,
|
||||
|
|
@ -1050,7 +1050,7 @@ watch(currentHq, () => {
|
|||
{{ $t('branch.allBranch') }}
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="isRoleInclude(['head_of_admin', 'admin', 'system'])"
|
||||
v-if="isRoleInclude(['system'])"
|
||||
round
|
||||
flat
|
||||
size="md"
|
||||
|
|
@ -1561,6 +1561,16 @@ watch(currentHq, () => {
|
|||
</q-td>
|
||||
<q-td>
|
||||
<KebabAction
|
||||
v-if="
|
||||
isRoleInclude([
|
||||
'system',
|
||||
'head_of_admin',
|
||||
'admin',
|
||||
'executive',
|
||||
'accountant',
|
||||
]) ||
|
||||
(canAccess('branch') && currentHq.id)
|
||||
"
|
||||
:status="props.row.status"
|
||||
:idName="props.row.name"
|
||||
@view="
|
||||
|
|
@ -1702,6 +1712,16 @@ watch(currentHq, () => {
|
|||
>
|
||||
<template v-slot:action>
|
||||
<KebabAction
|
||||
v-if="
|
||||
isRoleInclude([
|
||||
'system',
|
||||
'head_of_admin',
|
||||
'admin',
|
||||
'executive',
|
||||
'accountant',
|
||||
]) ||
|
||||
(canAccess('branch') && currentHq.id)
|
||||
"
|
||||
:status="props.row.status"
|
||||
:idName="props.row.name"
|
||||
@view="
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue