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="
|
v-if="
|
||||||
node.isHeadOffice &&
|
node.isHeadOffice &&
|
||||||
typeTree === 'branch' &&
|
typeTree === 'branch' &&
|
||||||
isRoleInclude(['head_of_admin', 'admin', 'system'])
|
isRoleInclude([
|
||||||
|
'system',
|
||||||
|
'head_of_admin',
|
||||||
|
'admin',
|
||||||
|
'executive',
|
||||||
|
'accountant',
|
||||||
|
])
|
||||||
"
|
"
|
||||||
:id="`create-sub-branch-btn-${node.name}`"
|
:id="`create-sub-branch-btn-${node.name}`"
|
||||||
@click.stop="$emit('create', node)"
|
@click.stop="$emit('create', node)"
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import type { QTableProps, QTableSlots } from 'quasar';
|
||||||
import { resetScrollBar } from 'src/stores/utils';
|
import { resetScrollBar } from 'src/stores/utils';
|
||||||
import useBranchStore from 'stores/branch';
|
import useBranchStore from 'stores/branch';
|
||||||
import useFlowStore from 'stores/flow';
|
import useFlowStore from 'stores/flow';
|
||||||
import { isRoleInclude } from 'stores/utils';
|
import { isRoleInclude, canAccess } from 'stores/utils';
|
||||||
import {
|
import {
|
||||||
BranchWithChildren,
|
BranchWithChildren,
|
||||||
BranchCreate,
|
BranchCreate,
|
||||||
|
|
@ -1050,7 +1050,7 @@ watch(currentHq, () => {
|
||||||
{{ $t('branch.allBranch') }}
|
{{ $t('branch.allBranch') }}
|
||||||
</div>
|
</div>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="isRoleInclude(['head_of_admin', 'admin', 'system'])"
|
v-if="isRoleInclude(['system'])"
|
||||||
round
|
round
|
||||||
flat
|
flat
|
||||||
size="md"
|
size="md"
|
||||||
|
|
@ -1561,6 +1561,16 @@ watch(currentHq, () => {
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td>
|
<q-td>
|
||||||
<KebabAction
|
<KebabAction
|
||||||
|
v-if="
|
||||||
|
isRoleInclude([
|
||||||
|
'system',
|
||||||
|
'head_of_admin',
|
||||||
|
'admin',
|
||||||
|
'executive',
|
||||||
|
'accountant',
|
||||||
|
]) ||
|
||||||
|
(canAccess('branch') && currentHq.id)
|
||||||
|
"
|
||||||
:status="props.row.status"
|
:status="props.row.status"
|
||||||
:idName="props.row.name"
|
:idName="props.row.name"
|
||||||
@view="
|
@view="
|
||||||
|
|
@ -1702,6 +1712,16 @@ watch(currentHq, () => {
|
||||||
>
|
>
|
||||||
<template v-slot:action>
|
<template v-slot:action>
|
||||||
<KebabAction
|
<KebabAction
|
||||||
|
v-if="
|
||||||
|
isRoleInclude([
|
||||||
|
'system',
|
||||||
|
'head_of_admin',
|
||||||
|
'admin',
|
||||||
|
'executive',
|
||||||
|
'accountant',
|
||||||
|
]) ||
|
||||||
|
(canAccess('branch') && currentHq.id)
|
||||||
|
"
|
||||||
:status="props.row.status"
|
:status="props.row.status"
|
||||||
:idName="props.row.name"
|
:idName="props.row.name"
|
||||||
@view="
|
@view="
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue