You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2021/11/14 16:19:18 UTC
[ofbiz-framework] branch trunk updated: Improved: view permission vis a vis editinvoice (OFBIZ-12380) (#340)
This is an automated email from the ASF dual-hosted git repository.
jleroux pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push:
new 8cdfc8e Improved: view permission vis a vis editinvoice (OFBIZ-12380) (#340)
8cdfc8e is described below
commit 8cdfc8e095f98fb7f7e67a05dcca4c0f0999feb3
Author: Pierre Smits <pi...@orrtiz.com>
AuthorDate: Sun Nov 14 17:19:13 2021 +0100
Improved: view permission vis a vis editinvoice (OFBIZ-12380) (#340)
added:
- AccountingMenus.xml: added permission conditions to 'editInvoice' menu-item
- InvoiceScreens.xml: added permission conditions to EditInvoice scrreen, reworked fail-widget
---
applications/accounting/widget/AccountingMenus.xml | 5 ++++-
applications/accounting/widget/InvoiceScreens.xml | 12 ++++++++----
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/applications/accounting/widget/AccountingMenus.xml b/applications/accounting/widget/AccountingMenus.xml
index 0f83119..8ce8593 100644
--- a/applications/accounting/widget/AccountingMenus.xml
+++ b/applications/accounting/widget/AccountingMenus.xml
@@ -97,7 +97,6 @@ under the License.
<parameter param-name="invoiceId" from-field="invoice.invoiceId"/>
</link>
</menu-item>
-
<menu-item name="editInvoice" title="${uiLabelMap.AccountingInvoiceHeader}">
<condition>
<and>
@@ -106,6 +105,10 @@ under the License.
<if-compare field="invoice.statusId" operator="equals" value="INVOICE_IN_PROCESS"/>
<if-compare field="invoice.statusId" operator="equals" value="INVOICE_RECEIVED"/>
</or>
+ <or>
+ <if-has-permission permission="ACCOUNTING" action="_CREATE"/>
+ <if-has-permission permission="ACCOUNTING" action="_UPDATE"/>
+ </or>
</and>
</condition>
<link target="editInvoice">
diff --git a/applications/accounting/widget/InvoiceScreens.xml b/applications/accounting/widget/InvoiceScreens.xml
index 633ab06..312fc31 100644
--- a/applications/accounting/widget/InvoiceScreens.xml
+++ b/applications/accounting/widget/InvoiceScreens.xml
@@ -156,7 +156,13 @@ under the License.
<decorator-section name="body">
<section>
<condition>
- <if-compare field="invoice.statusId" operator="equals" value="INVOICE_IN_PROCESS"/>
+ <and>
+ <or>
+ <if-has-permission permission="ACCOUNTING" action="_CREATE"/>
+ <if-has-permission permission="ACCOUNTING" action="_UPDATE"/>
+ </or>
+ <if-compare field="invoice.statusId" operator="equals" value="INVOICE_IN_PROCESS"/>
+ </and>
</condition>
<widgets>
<screenlet title="${uiLabelMap.PageTitleEditInvoice}">
@@ -164,9 +170,7 @@ under the License.
</screenlet>
</widgets>
<fail-widgets>
- <screenlet title="${uiLabelMap.PageTitleEditInvoice}">
- <include-form name="InvoiceHeader" location="component://accounting/widget/InvoiceForms.xml"/>
- </screenlet>
+ <label style="h3" text="${uiLabelMap.AccountingPermissionError}"/>
</fail-widgets>
</section>
</decorator-section>