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 7b88918  Improved: 'VIEW' permissions and invoice time-entries 
(OFBIZ-12416) (#362)
7b88918 is described below

commit 7b88918c3e5a4499b3f4f041e4c1cac0b94fa046
Author: Pierre Smits <[email protected]>
AuthorDate: Sun Nov 28 14:19:14 2021 +0100

    Improved: 'VIEW' permissions and invoice time-entries (OFBIZ-12416) (#362)
    
    Currently, a user with only 'VIEW' permissions, as demonstrated in trunk 
demo with userId = auditor, accessing the items screen on an invoice sees 
fields editable and triggers to requests reserved for users with 'CREATE' or 
'UPDATE' permissions.
    
    modified: InvoiceScreens.xml
    restructured screen EditInvoiceTimeEntries, to show appropriate content 
based on the permissions of the user
---
 applications/accounting/widget/InvoiceScreens.xml | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/applications/accounting/widget/InvoiceScreens.xml 
b/applications/accounting/widget/InvoiceScreens.xml
index bdf7ecf..9e245a6 100644
--- a/applications/accounting/widget/InvoiceScreens.xml
+++ b/applications/accounting/widget/InvoiceScreens.xml
@@ -535,7 +535,22 @@ under the License.
                 <decorator-screen name="CommonInvoiceDecorator" 
location="${parameters.invoiceDecoratorLocation}">
                     <decorator-section name="body">
                         <screenlet 
title="${uiLabelMap.AccountingInvoiceTimeEntries}">
-                            <include-form name="EditTimeEntries" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                        <section>
+                            <condition>
+                                <and>
+                                    <or>
+                                        <if-has-permission 
permission="ACCOUNTING" action="_CREATE"/>
+                                        <if-has-permission 
permission="ACCOUNTING" action="_UPDATE"/>
+                                    </or>
+                                </and>
+                            </condition>
+                            <widgets>
+                                <include-form name="EditTimeEntries" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                            </widgets>
+                            <fail-widgets>
+                                <include-form name="ListTimeEntries" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                            </fail-widgets>
+                        </section>
                         </screenlet>
                     </decorator-section>
                 </decorator-screen>

Reply via email to