diff --git a/src/components/ui/VnPaginate.vue b/src/components/ui/VnPaginate.vue index c27111df4..42fa4f766 100644 --- a/src/components/ui/VnPaginate.vue +++ b/src/components/ui/VnPaginate.vue @@ -115,8 +115,8 @@ watch( ); watch( - () => [props.url, props.filter], - ([url, filter]) => fetch({ url, filter }) + () => [props.url, props.filter, props.userParams], + ([url, filter, userParams]) => fetch({ url, filter, userParams }) ); const addFilter = async (filter, params) => { diff --git a/src/pages/Account/AccountList.vue b/src/pages/Account/AccountList.vue index dee019fed..79c77a3c1 100644 --- a/src/pages/Account/AccountList.vue +++ b/src/pages/Account/AccountList.vue @@ -13,7 +13,7 @@ import AccountCreate from './AccountCreate.vue'; import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import { useStateStore } from 'stores/useStateStore'; -import { useRole } from 'src/composables/useRole'; +import { useAcl } from 'src/composables/useAcl'; import { QDialog } from 'quasar'; const stateStore = useStateStore(); @@ -21,7 +21,7 @@ const router = useRouter(); const { t } = useI18n(); const { viewSummary } = useSummaryDialog(); const accountCreateDialogRef = ref(null); -const showNewUserBtn = computed(() => useRole().hasAny(['itManagement'])); +const showNewUserBtn = computed(() => useAcl().hasAny('Account', '*', 'WRITE')); const filter = { fields: ['id', 'nickname', 'name', 'role'], diff --git a/src/pages/Customer/Card/CustomerBalance.vue b/src/pages/Customer/Card/CustomerBalance.vue index 411c44ad3..2dc0c5564 100644 --- a/src/pages/Customer/Card/CustomerBalance.vue +++ b/src/pages/Customer/Card/CustomerBalance.vue @@ -2,7 +2,7 @@ import { computed, onBeforeMount, ref } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRoute } from 'vue-router'; -import { useRole } from 'src/composables/useRole'; +import { useAcl } from 'src/composables/useAcl'; import axios from 'axios'; import { useQuasar } from 'quasar'; @@ -25,7 +25,7 @@ import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescr const { openConfirmationModal } = useVnConfirm(); const { sendEmail } = usePrintService(); const { t } = useI18n(); -const { hasAny } = useRole(); +const { hasAny } = useAcl(); const session = useSession(); const tokenMultimedia = session.getTokenMultimedia(); @@ -317,7 +317,7 @@ const showBalancePdf = ({ id }) => { > diff --git a/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue b/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue index da24e50fa..17e5133ab 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue @@ -5,7 +5,7 @@ import { useI18n } from 'vue-i18n'; import { useQuasar } from 'quasar'; import axios from 'axios'; import { toCurrency, toDate } from 'src/filters'; -import { useRole } from 'src/composables/useRole'; +import { useAcl } from 'src/composables/useAcl'; import { downloadFile } from 'src/composables/downloadFile'; import { useArrayData } from 'src/composables/useArrayData'; import { usePrintService } from 'composables/usePrintService'; @@ -24,7 +24,7 @@ const $props = defineProps({ id: { type: Number, default: null } }); const { push, currentRoute } = useRouter(); const quasar = useQuasar(); -const { hasAny } = useRole(); +const { hasAny } = useAcl(); const { t } = useI18n(); const { openReport, sendEmail } = usePrintService(); const arrayData = useArrayData(); @@ -195,10 +195,9 @@ async function cloneInvoice() { push({ path: `/invoice-in/${data.id}/summary` }); } -const isAdministrative = () => hasAny(['administrative']); +const canEditProp = (prop) => hasAny('InvoiceIn', prop, 'WRITE'); const isAgricultural = () => { - console.error(config); if (!config.value) return false; return ( invoiceIn.value?.supplier?.sageFarmerWithholdingFk === @@ -284,7 +283,7 @@ const createInvoiceInCorrection = async () => { { { {{ t('Delete invoice') }} { option-label="code" option-value="id" hide-selected - :readonly="!hasAny(['productionBoss', 'hr'])" + :readonly="!hasAny('Worker','__get__locker','READ')" />