#4074 useAcls #584

Merged
jorgep merged 30 commits from 4074-useAcls into dev 2024-09-10 11:50:45 +00:00
3 changed files with 5 additions and 3 deletions
Showing only changes of commit 6438f36eca - Show all commits

View File

@ -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];

View File

@ -284,7 +284,9 @@ const showBalancePdf = ({ id }) => {
>
<VnInput
v-model="scope.value"
:disable="!hasAny('Receipt','*', 'WRITE')"
:disable="
!hasAny([{ model: 'Receipt', props: '*', accessType: 'WRITE' }])
"
@keypress.enter="scope.set"
autofocus
/>

View File

@ -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;