Only include "export invoice" logic if user has perm

This commit is contained in:
Lance Edgar 2023-01-11 07:49:05 -06:00
parent 75e720d679
commit dda03fd655

View file

@ -3,9 +3,10 @@
<%def name="grid_tools()">
${parent.grid_tools()}
% if master.has_perm('export'):
${h.form(url('{}.export'.format(route_prefix)), **{'@submit': 'exportingInvoices = true'})}
${h.csrf_token(request)}
% if master.has_perm('export'):
<b-button type="is-primary"
native-type="submit"
icon-pack="fas"
@ -13,12 +14,13 @@
:disabled="exportingInvoices || !exportingInvoicesCount">
{{ exportingInvoices ? "Working, please wait..." : `Export ${'$'}{this.exportingInvoicesCount} Invoices` }}
</b-button>
% endif
${h.end_form()}
% endif
</%def>
<%def name="modify_this_page_vars()">
${parent.modify_this_page_vars()}
% if master.has_perm('export'):
<script type="text/javascript">
${grid.component_studly}Data.exportingInvoices = false
@ -82,6 +84,7 @@
}
</script>
% endif
</%def>