refactor: refs #4074 accept array
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
803ce3b909
commit
6438f36eca
|
@ -17,7 +17,6 @@ export function useAcl() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function hasAny(acls) {
|
function hasAny(acls) {
|
||||||
if (!Array.isArray(acls)) acls = [acls];
|
|
||||||
for (const acl of acls) {
|
for (const acl of acls) {
|
||||||
let { model, props, accessType } = acl;
|
let { model, props, accessType } = acl;
|
||||||
const modelAcls = state.getAcls().value[model];
|
const modelAcls = state.getAcls().value[model];
|
||||||
|
|
|
@ -284,7 +284,9 @@ const showBalancePdf = ({ id }) => {
|
||||||
>
|
>
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="scope.value"
|
v-model="scope.value"
|
||||||
:disable="!hasAny('Receipt','*', 'WRITE')"
|
:disable="
|
||||||
|
!hasAny([{ model: 'Receipt', props: '*', accessType: 'WRITE' }])
|
||||||
|
"
|
||||||
@keypress.enter="scope.set"
|
@keypress.enter="scope.set"
|
||||||
autofocus
|
autofocus
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -195,7 +195,8 @@ async function cloneInvoice() {
|
||||||
push({ path: `/invoice-in/${data.id}/summary` });
|
push({ path: `/invoice-in/${data.id}/summary` });
|
||||||
}
|
}
|
||||||
|
|
||||||
const canEditProp = (prop) => hasAny('InvoiceIn', prop, 'WRITE');
|
const canEditProp = (props) =>
|
||||||
|
hasAny([{ model: 'InvoiceIn', props, accessType: 'WRITE' }]);
|
||||||
|
|
||||||
const isAgricultural = () => {
|
const isAgricultural = () => {
|
||||||
if (!config.value) return false;
|
if (!config.value) return false;
|
||||||
|
|
Loading…
Reference in New Issue