From 6438f36ecaa880f68aedf76b96fc51c5f16d460b Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 9 Sep 2024 12:28:14 +0200 Subject: [PATCH] refactor: refs #4074 accept array --- src/composables/useAcl.js | 1 - src/pages/Customer/Card/CustomerBalance.vue | 4 +++- src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/composables/useAcl.js b/src/composables/useAcl.js index 539e89622..ede359186 100644 --- a/src/composables/useAcl.js +++ b/src/composables/useAcl.js @@ -17,7 +17,6 @@ export function useAcl() { } function hasAny(acls) { - if (!Array.isArray(acls)) acls = [acls]; for (const acl of acls) { let { model, props, accessType } = acl; const modelAcls = state.getAcls().value[model]; diff --git a/src/pages/Customer/Card/CustomerBalance.vue b/src/pages/Customer/Card/CustomerBalance.vue index 501ea6d68..95f5f0981 100644 --- a/src/pages/Customer/Card/CustomerBalance.vue +++ b/src/pages/Customer/Card/CustomerBalance.vue @@ -284,7 +284,9 @@ const showBalancePdf = ({ id }) => { > diff --git a/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue b/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue index d431e1f96..b7f470b0c 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue @@ -195,7 +195,8 @@ async function cloneInvoice() { 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 = () => { if (!config.value) return false;