svn commit: r1768188 [1/2] - in /ofbiz/trunk: applications/accounting/minilang/payment/ applications/accounting/minilang/rate/ applications/accounting/servicedef/ applications/content/minilang/compdoc/ applications/content/minilang/content/ application...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1768188 [1/2] - in /ofbiz/trunk: applications/accounting/minilang/payment/ applications/accounting/minilang/rate/ applications/accounting/servicedef/ applications/content/minilang/compdoc/ applications/content/minilang/content/ application...

Deepak Dixit-5
Author: deepak
Date: Sat Nov  5 11:10:57 2016
New Revision: 1768188

URL: http://svn.apache.org/viewvc?rev=1768188&view=rev
Log:
Improved: Added generic permission service for following
- facility
- marketting
- return
- entitysync
Also moved  the permission check from implementation level to service defination level

(OFBIZ-8673)(OFBIZ-8673)(OFBIZ-8674)(OFBIZ-8739)(OFBIZ-8823)(OFBIZ-8825)(OFBIZ-8827)(OFBIZ-8850)(OFBIZ-8876)(OFBIZ-8875)(OFBIZ-8824)(OFBIZ-8826)(OFBIZ-8851)

Thanks Nameet Jain for your contribution

Added:
    ofbiz/trunk/applications/marketing/minilang/permission/
    ofbiz/trunk/applications/marketing/minilang/permission/PermissionServices.xml   (with props)
    ofbiz/trunk/applications/order/minilang/permission/
    ofbiz/trunk/applications/order/minilang/permission/PermissionServices.xml   (with props)
    ofbiz/trunk/applications/order/servicedef/services_perm.xml   (with props)
    ofbiz/trunk/applications/product/minilang/permission/
    ofbiz/trunk/applications/product/minilang/permission/PermissionServices.xml   (with props)
    ofbiz/trunk/applications/product/servicedef/services_perm.xml   (with props)
Modified:
    ofbiz/trunk/applications/accounting/minilang/payment/PaymentServices.xml
    ofbiz/trunk/applications/accounting/minilang/rate/RateServices.xml
    ofbiz/trunk/applications/accounting/servicedef/services_payment.xml
    ofbiz/trunk/applications/accounting/servicedef/services_rate.xml
    ofbiz/trunk/applications/content/minilang/compdoc/CompDocServices.xml
    ofbiz/trunk/applications/content/minilang/content/ContentServices.xml
    ofbiz/trunk/applications/content/minilang/survey/SurveyServices.xml
    ofbiz/trunk/applications/content/servicedef/services.xml
    ofbiz/trunk/applications/marketing/minilang/marketing/contact/ContactListServices.xml
    ofbiz/trunk/applications/marketing/minilang/marketing/tracking/TrackingCodeServices.xml
    ofbiz/trunk/applications/marketing/servicedef/services.xml
    ofbiz/trunk/applications/order/minilang/order/OrderReturnServices.xml
    ofbiz/trunk/applications/order/ofbiz-component.xml
    ofbiz/trunk/applications/order/servicedef/services_return.xml
    ofbiz/trunk/applications/product/minilang/product/inventory/StockMoveServices.xml
    ofbiz/trunk/applications/product/minilang/product/storage/FacilityContactMechServices.xml
    ofbiz/trunk/applications/product/minilang/shipment/picklist/PicklistServices.xml
    ofbiz/trunk/applications/product/ofbiz-component.xml
    ofbiz/trunk/applications/product/servicedef/services_facility.xml
    ofbiz/trunk/applications/product/servicedef/services_picklist.xml
    ofbiz/trunk/applications/workeffort/minilang/timesheet/TimesheetServices.xml
    ofbiz/trunk/applications/workeffort/minilang/workeffort/WorkEffortSimpleServices.xml
    ofbiz/trunk/applications/workeffort/servicedef/services.xml
    ofbiz/trunk/applications/workeffort/servicedef/services_timesheet.xml
    ofbiz/trunk/framework/entityext/minilang/EntitySyncServices.xml
    ofbiz/trunk/framework/entityext/servicedef/services.xml
    ofbiz/trunk/specialpurpose/scrum/minilang/ScrumServices.xml
    ofbiz/trunk/specialpurpose/scrum/servicedef/services.xml

Modified: ofbiz/trunk/applications/accounting/minilang/payment/PaymentServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/minilang/payment/PaymentServices.xml?rev=1768188&r1=1768187&r2=1768188&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/minilang/payment/PaymentServices.xml (original)
+++ ofbiz/trunk/applications/accounting/minilang/payment/PaymentServices.xml Sat Nov  5 11:10:57 2016
@@ -285,11 +285,6 @@ under the License.
     </simple-method>
 
     <simple-method method-name="setPaymentStatus" short-description="Set The Payment Status">
-        <check-permission permission="ACCOUNTING" action="_UPDATE">
-            <alt-permission permission="ACCOUNTING_ROLE" action="_UPDATE"/>
-            <fail-property resource="AccountingUiLabels" property="AccountingPermissionError"/>
-        </check-permission>
-
         <entity-one entity-name="Payment" value-field="payment"/>
         <entity-one entity-name="StatusItem" value-field="statusItem">
             <field-map field-name="statusId" from-field="parameters.statusId"/>
@@ -534,10 +529,6 @@ under the License.
     </simple-method>
 
     <simple-method method-name="voidPayment" short-description="Service to void a payment">
-        <check-permission permission="ACCOUNTING" action="_UPDATE">
-            <alt-permission permission="ACCOUNTING_ROLE" action="_UPDATE"/>
-            <fail-property resource="AccountingUiLabels" property="AccountingPermissionError"/>
-        </check-permission>
         <entity-one entity-name="Payment" value-field="payment"/>
         <field-to-result field="payment.finAccountTransId" result-name="finAccountTransId"/>
         <set field="transStatusId" value="FINACT_TRNS_CANCELED"/>

Modified: ofbiz/trunk/applications/accounting/minilang/rate/RateServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/minilang/rate/RateServices.xml?rev=1768188&r1=1768187&r2=1768188&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/minilang/rate/RateServices.xml (original)
+++ ofbiz/trunk/applications/accounting/minilang/rate/RateServices.xml Sat Nov  5 11:10:57 2016
@@ -22,12 +22,6 @@ under the License.
         xmlns="http://ofbiz.apache.org/Simple-Method" xsi:schemaLocation="http://ofbiz.apache.org/Simple-Method http://ofbiz.apache.org/dtds/simple-methods.xsd">
 
     <simple-method method-name="updateRateAmount" short-description="update/create a rate amount value">
-        <set value="_CREATE" field="securityAction"/>
-        <check-permission permission="ACCOUNTING" action="${securityAction}">
-            <fail-property resource="AccountingUiLabels" property="AccountingPermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <!-- set defaults -->
         <if-empty field="parameters.rateCurrencyUomId">
             <property-to-field resource="general.properties" property="currency.uom.id.default" field="parameters.rateCurrencyUomId"/>
@@ -73,12 +67,6 @@ under the License.
     </simple-method>
 
     <simple-method method-name="deleteRateAmount" short-description="update/create a rate amount value">
-        <set value="_CREATE" field="securityAction"/>
-        <check-permission permission="ACCOUNTING" action="${securityAction}">
-            <fail-property resource="AccountingUiLabels" property="AccountingPermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <!-- set defaults -->
         <if-empty field="parameters.rateCurrencyUomId">
             <property-to-field resource="general.properties" property="currency.uom.id.default" field="parameters.rateCurrencyUomId"/>
@@ -113,11 +101,6 @@ under the License.
     </simple-method>
 
     <simple-method method-name="getRateAmount" short-description="Get the applicable rate amount value">
-        <set value="_READ" field="securityAction"/>
-        <check-permission permission="ACCOUNTING" action="${securityAction}">
-            <fail-property resource="AccountingUiLabels" property="AccountingPermissionError"/>
-        </check-permission>
-        <check-errors/>
         <!--
            Search for the applicable rate from most specific to most general in the RateAmount entity
            Defaults for periodTypeId is per hour and default currency is the currency in general.properties
@@ -225,12 +208,6 @@ under the License.
     </simple-method>
 
     <simple-method method-name="getRatesAmountsFromWorkEffortId" short-description="Get all the rateAmount for a given workEffortId">
-        <set value="_READ" field="securityAction"/>
-        <check-permission permission="ACCOUNTING" action="${securityAction}">
-            <fail-property resource="AccountingUiLabels" property="AccountingPermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <entity-and entity-name="RateAmount" list="amounts" filter-by-date="true">
             <field-map field-name="rateTypeId" from-field="parameters.rateTypeId"/>
             <field-map field-name="workEffortId" from-field="parameters.workEffortId"/>
@@ -254,12 +231,6 @@ under the License.
     </simple-method>
 
     <simple-method method-name="getRatesAmountsFromPartyId" short-description="Get all the rateAmount for a given partyId">
-        <set value="_READ" field="securityAction"/>
-        <check-permission permission="ACCOUNTING" action="${securityAction}">
-            <fail-property resource="AccountingUiLabels" property="AccountingPermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <entity-and entity-name="RateAmount" list="amounts" filter-by-date="true">
             <field-map field-name="rateTypeId" from-field="parameters.rateTypeId"/>
             <field-map field-name="partyId" from-field="parameters.partyId"/>
@@ -282,12 +253,6 @@ under the License.
     </simple-method>
 
     <simple-method method-name="getRatesAmountsFromEmplPositionTypeId" short-description="Get all the rateAmount for a given emplPositionTypeId">
-        <set value="_READ" field="securityAction"/>
-        <check-permission permission="ACCOUNTING" action="${securityAction}">
-            <fail-property resource="AccountingUiLabels" property="AccountingPermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <entity-and entity-name="RateAmount" list="amounts" filter-by-date="true">
             <field-map field-name="rateTypeId" from-field="parameters.rateTypeId"/>
             <field-map field-name="emplPositionTypeId" from-field="parameters.emplPositionTypeId"/>
@@ -370,12 +335,6 @@ under the License.
 
     <!-- party rate services -->
     <simple-method method-name="updatePartyRate" short-description="Update/Create PartyRate">
-        <set value="_CREATE" field="securityAction"/>
-        <check-permission permission="ACCOUNTING" action="${securityAction}">
-            <fail-property resource="AccountingUiLabels" property="AccountingPermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <!-- check if already exist is so expire current record -->
         <entity-and entity-name="PartyRate" list="partyRates" filter-by-date="true">
             <field-map field-name="partyId" from-field="parameters.partyId"/>
@@ -419,12 +378,6 @@ under the License.
         </if-compare>
     </simple-method>
     <simple-method method-name="deletePartyRate" short-description="Delete PartyRate">
-        <set value="_UPDATE" field="securityAction"/>
-        <check-permission permission="ACCOUNTING" action="${securityAction}">
-            <fail-property resource="AccountingUiLabels" property="AccountingPermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <entity-one entity-name="PartyRate" value-field="lookedUpValue"/>
         <now-timestamp field="lookedUpValue.thruDate"/>
         <store-value value-field="lookedUpValue"/>

Modified: ofbiz/trunk/applications/accounting/servicedef/services_payment.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_payment.xml?rev=1768188&r1=1768187&r2=1768188&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/services_payment.xml (original)
+++ ofbiz/trunk/applications/accounting/servicedef/services_payment.xml Sat Nov  5 11:10:57 2016
@@ -47,6 +47,7 @@ under the License.
     <service name="setPaymentStatus" engine="simple" default-entity-name="Payment"
         location="component://accounting/minilang/payment/PaymentServices.xml" invoke="setPaymentStatus" auth="true">
         <description>Change the status of a Payment</description>
+        <permission-service service-name="acctgPaymentPermissionCheck" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <attribute name="statusId" type="String" mode="IN" optional="false"/>
         <attribute name="oldStatusId" type="String" mode="OUT" optional="true"/>
@@ -145,6 +146,7 @@ under the License.
             location="component://accounting/minilang/payment/PaymentServices.xml" invoke="voidPayment" auth="true">
         <description>Sets payment status to PMNT_VOID, removes all PaymentApplications, changes related invoice statuses to
             INVOICE_READY if status is INVOICE_PAID, and reverses related AcctgTrans by calling copyAcctgTransAndEntries service</description>
+        <permission-service service-name="acctgPaymentPermissionCheck" main-action="UPDATE"/>
         <attribute name="paymentId" mode="IN" optional="false" type="String"/>
         <attribute name="finAccountTransId" type="String" mode="OUT" optional="true"/>
         <attribute name="statusId" type="String" mode="OUT" optional="true"/>

Modified: ofbiz/trunk/applications/accounting/servicedef/services_rate.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_rate.xml?rev=1768188&r1=1768187&r2=1768188&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/services_rate.xml (original)
+++ ofbiz/trunk/applications/accounting/servicedef/services_rate.xml Sat Nov  5 11:10:57 2016
@@ -27,6 +27,7 @@ under the License.
     <service name="updateRateAmount" default-entity-name="RateAmount" engine="simple" auth="true"
         location="component://accounting/minilang/rate/RateServices.xml" invoke="updateRateAmount">
         <description>Create/update Rate Amount</description>
+        <permission-service service-name="acctgBasePermissionCheck" main-action="CREATE"/>
         <auto-attributes include="all" mode="IN" optional="true"/>
         <override name="rateTypeId" optional="false"/>
         <override name="rateAmount" optional="false"/>
@@ -34,6 +35,7 @@ under the License.
     <service name="deleteRateAmount" default-entity-name="RateAmount" engine="simple" auth="true"
         location="component://accounting/minilang/rate/RateServices.xml" invoke="deleteRateAmount">
         <description>Delete (expire) Rate Amount</description>
+        <permission-service service-name="acctgBasePermissionCheck" main-action="CREATE"/>
         <auto-attributes include="pk" mode="IN" optional="true"/>
         <override name="rateTypeId" optional="false"/>
         <override name="fromDate" optional="false"/>
@@ -41,6 +43,7 @@ under the License.
     <service name="getRateAmount" default-entity-name="RateAmount" engine="simple" auth="true"
         location="component://accounting/minilang/rate/RateServices.xml" invoke="getRateAmount">
         <description>Get Rate Amount</description>
+        <permission-service service-name="acctgBasePermissionCheck" main-action="READ"/>
         <auto-attributes include="pk" mode="IN" optional="true"/>
         <attribute name="level" type="String" mode="OUT" optional="true"/><!-- the level the amount was retrieved from(specific -> general): workEffort, party, emplPositionType, rateType or 'null' if not found-->
         <attribute name="rateAmount" type="BigDecimal" mode="OUT" optional="true"/>
@@ -52,6 +55,7 @@ under the License.
     <service name="getRatesAmountsFromWorkEffortId" default-entity-name="RateAmount" engine="simple" auth="true"
              location="component://accounting/minilang/rate/RateServices.xml" invoke="getRatesAmountsFromWorkEffortId">
         <description>Get all Rates Amounts for a given workEffortId</description>
+        <permission-service service-name="acctgBasePermissionCheck" main-action="READ"/>
         <auto-attributes include="pk" mode="IN" optional="true"/>
         <attribute name="periodTypeId" type="String" mode="INOUT" optional="true"/>
         <attribute name="rateCurrencyUomId" type="String" mode="INOUT" optional="true"/>
@@ -62,6 +66,7 @@ under the License.
     <service name="getRatesAmountsFromPartyId" default-entity-name="RateAmount" engine="simple" auth="true"
              location="component://accounting/minilang/rate/RateServices.xml" invoke="getRatesAmountsFromPartyId">
         <description>Get all Rates Amounts for a given partyId</description>
+        <permission-service service-name="acctgBasePermissionCheck" main-action="READ"/>
         <auto-attributes include="pk" mode="IN" optional="true"/>
         <attribute name="periodTypeId" type="String" mode="INOUT" optional="true"/>
         <attribute name="rateCurrencyUomId" type="String" mode="INOUT" optional="true"/>
@@ -72,6 +77,7 @@ under the License.
     <service name="getRatesAmountsFromEmplPositionTypeId" default-entity-name="RateAmount" engine="simple" auth="true"
              location="component://accounting/minilang/rate/RateServices.xml" invoke="getRatesAmountsFromEmplPositionTypeId">
         <description>Get all Rates Amounts for a given emplPositionTypeId</description>
+        <permission-service service-name="acctgBasePermissionCheck" main-action="READ"/>
         <auto-attributes include="pk" mode="IN" optional="true"/>
         <attribute name="periodTypeId" type="String" mode="INOUT" optional="true"/>
         <attribute name="rateCurrencyUomId" type="String" mode="INOUT" optional="true"/>
@@ -93,6 +99,7 @@ under the License.
     <service name="updatePartyRate" default-entity-name="PartyRate" engine="simple" auth="true"
         location="component://accounting/minilang/rate/RateServices.xml" invoke="updatePartyRate">
         <description>Creates PartyRate</description>
+        <permission-service service-name="acctgBasePermissionCheck" main-action="CREATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
         <attribute name="organizationPartyId" type="String" mode="IN" optional="true"/>
@@ -104,6 +111,7 @@ under the License.
     <service name="deletePartyRate" default-entity-name="PartyRate" engine="simple" auth="true"
         location="component://accounting/minilang/rate/RateServices.xml" invoke="deletePartyRate">
         <description>Deletes PartyRate</description>
+        <permission-service service-name="acctgBasePermissionCheck" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <attribute name="rateAmountFromDate" type="Timestamp" mode="IN" optional="true"/><!-- to be able to expire rateamount specific to a party records....-->
     </service>

Modified: ofbiz/trunk/applications/content/minilang/compdoc/CompDocServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/minilang/compdoc/CompDocServices.xml?rev=1768188&r1=1768187&r2=1768188&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/minilang/compdoc/CompDocServices.xml (original)
+++ ofbiz/trunk/applications/content/minilang/compdoc/CompDocServices.xml Sat Nov  5 11:10:57 2016
@@ -694,10 +694,6 @@ under the License.
     <simple-method method-name="prepForApproval" short-description="Set ContentApprovals for approval process">
         <log level="info" message="got into prepForApproval- parameters: ${parameters}"/>
         <set field="rootContentId" from-field="parameters.rootContentId"/>
-        <check-permission action="_CREATE" permission="CONTENTMGR">
-            <fail-property resource="ContentUiLabels" property="ContentSecurityCreatePermission"/>
-        </check-permission>
-        <check-errors/>
         <!--  bump CDI up one for new approval -->
         <set field="context2.contentId" from-field="parameters.rootContentId"/>
         <call-service service-name="persistContentRevisionAndItem" in-map-name="context2">

Modified: ofbiz/trunk/applications/content/minilang/content/ContentServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/minilang/content/ContentServices.xml?rev=1768188&r1=1768187&r2=1768188&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/minilang/content/ContentServices.xml (original)
+++ ofbiz/trunk/applications/content/minilang/content/ContentServices.xml Sat Nov  5 11:10:57 2016
@@ -312,11 +312,6 @@
 
     <!-- Generic content services -->
     <simple-method method-name="createEmailContent" short-description="Create Email as Content">
-        <check-permission permission="CONTENTMGR" action="_CREATE">
-            <fail-property resource="ContentUiLabels" property="ContentSecurityCreatePermission"/>
-        </check-permission>
-        <check-errors/>
-
         <!-- Create subject -->
         <set-service-fields service-name="createContent" map="parameters" to-map="createSubjectContent"/>
         <set from-field="parameters.subject" field="createSubjectEtext.textData"/>
@@ -355,11 +350,6 @@
         <field-to-result field="createBodyAssoc.contentId" result-name="contentId"/>
     </simple-method>
     <simple-method method-name="updateEmailContent" short-description="Update Email Content">
-        <check-permission permission="CONTENTMGR" action="_UPDATE">
-            <fail-property resource="ContentUiLabels" property="ContentSecurityUpdatePermission"/>
-        </check-permission>
-        <check-errors/>
-
         <if-not-empty field="parameters.subjectDataResourceId">
             <set from-field="parameters.subjectDataResourceId" field="updateSubjectEt.dataResourceId"/>
             <set from-field="parameters.subject" field="updateSubjectEt.textData"/>
@@ -378,11 +368,6 @@
     </simple-method>
 
     <simple-method method-name="createDownloadContent" short-description="Create Download as Content">
-        <check-permission permission="CONTENTMGR" action="_CREATE">
-            <fail-property resource="ContentUiLabels" property="ContentSecurityCreatePermission"/>
-        </check-permission>
-        <check-errors/>
-
         <set-service-fields service-name="createContent" map="parameters" to-map="createDownloadContent"/>
         <set from-field="parameters.file" field="createDownload.dataResourceContent"/>
         <call-service service-name="createOtherDataResource" in-map-name="createDownload">
@@ -393,11 +378,6 @@
         </call-service>
     </simple-method>
     <simple-method method-name="updateDownloadContent" short-description="Update Download Content">
-        <check-permission permission="CONTENTMGR" action="_UPDATE">
-            <fail-property resource="ContentUiLabels" property="ContentSecurityUpdatePermission"/>
-        </check-permission>
-        <check-errors/>
-
         <if-not-empty field="parameters.fileDataResourceId">
             <set from-field="parameters.fileDataResourceId" field="updateFile.dataResourceId"/>
             <set from-field="parameters.file" field="updateFile.dataResourceContent"/>
@@ -406,11 +386,6 @@
     </simple-method>
 
     <simple-method method-name="createSimpleTextContent" short-description="Create Simple Text Content">
-        <check-permission permission="CONTENTMGR" action="_CREATE">
-            <fail-property resource="ContentUiLabels" property="ContentSecurityCreatePermission"/>
-        </check-permission>
-        <check-errors/>
-
         <set-service-fields service-name="createContent" map="parameters" to-map="createSimpleTextContent"/>
         <set value="DOCUMENT" field="createSimpleTextContent.contentTypeId"/>
 
@@ -432,11 +407,6 @@
         </call-service>
     </simple-method>
     <simple-method method-name="updateSimpleTextContent" short-description="Update Simple Text Content">
-        <check-permission permission="CONTENTMGR" action="_UPDATE">
-            <fail-property resource="ContentUiLabels" property="ContentSecurityUpdatePermission"/>
-        </check-permission>
-        <check-errors/>
-
         <if-not-empty field="parameters.textDataResourceId">
             <set from-field="parameters.textDataResourceId" field="updateSimpleText.dataResourceId"/>
             <set from-field="parameters.text" field="updateSimpleText.textData"/>

Modified: ofbiz/trunk/applications/content/minilang/survey/SurveyServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/minilang/survey/SurveyServices.xml?rev=1768188&r1=1768187&r2=1768188&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/minilang/survey/SurveyServices.xml (original)
+++ ofbiz/trunk/applications/content/minilang/survey/SurveyServices.xml Sat Nov  5 11:10:57 2016
@@ -23,9 +23,6 @@
 
     <!-- Methods for SurveyQuestion -->
     <simple-method method-name="createSurveyQuestion" short-description="Create Survey Question">
-        <check-permission action="_CREATE" permission="CONTENTMGR">
-            <fail-property resource="ContentUiLabels" property="ContentSecurityCreatePermission"/>
-        </check-permission>
         <if>
             <condition>
                 <and>
@@ -65,9 +62,6 @@
         <field-to-result result-name="surveyQuestionId" field="newEntity.surveyQuestionId"/>
     </simple-method>
     <simple-method method-name="updateSurveyQuestion" short-description="Update Survey Question">
-        <check-permission action="_UPDATE" permission="CONTENTMGR">
-            <fail-property resource="ContentUiLabels" property="ContentSecurityUpdatePermission"/>
-        </check-permission>
         <if>
             <condition>
                 <and>

Modified: ofbiz/trunk/applications/content/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/servicedef/services.xml?rev=1768188&r1=1768187&r2=1768188&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/content/servicedef/services.xml Sat Nov  5 11:10:57 2016
@@ -141,6 +141,7 @@
 
     <!-- Generic Content Services -->
     <service name="createEmailContent" engine="simple" location="component://content/minilang/content/ContentServices.xml" invoke="createEmailContent">
+        <permission-service service-name="contentManagerPermission" main-action="CREATE"/>
         <auto-attributes mode="IN" entity-name="Content" optional="true"/>
         <attribute name="subject" type="String" mode="IN" optional="false"/>
         <attribute name="plainBody" type="String" mode="IN" optional="false"/>
@@ -148,6 +149,7 @@
         <override name="contentId" mode="INOUT"/>
     </service>
     <service name="updateEmailContent" engine="simple" location="component://content/minilang/content/ContentServices.xml" invoke="updateEmailContent">
+        <permission-service service-name="contentManagerPermission" main-action="UPDATE"/>
         <attribute name="subjectDataResourceId" type="String" mode="IN" optional="true"/>
         <attribute name="subject" type="String" mode="IN" optional="true"/>
         <attribute name="plainBodyDataResourceId" type="String" mode="IN" optional="true"/>
@@ -157,21 +159,25 @@
     </service>
 
     <service name="createDownloadContent" engine="simple" location="component://content/minilang/content/ContentServices.xml" invoke="createDownloadContent">
+        <permission-service service-name="contentManagerPermission" main-action="CREATE"/>
         <auto-attributes mode="IN" entity-name="Content" optional="true"/>
         <attribute name="file" type="String" mode="IN" optional="false"/>
         <override name="contentId" mode="INOUT"/>
     </service>
     <service name="updateDownloadContent" engine="simple" location="component://content/minilang/content/ContentServices.xml" invoke="updateDownloadContent">
+        <permission-service service-name="contentManagerPermission" main-action="UPDATE"/>
         <attribute name="fileDataResourceId" type="String" mode="IN" optional="true"/>
         <attribute name="file" type="String" mode="IN" optional="true"/>
     </service>
 
     <service name="createSimpleTextContent" engine="simple" location="component://content/minilang/content/ContentServices.xml" invoke="createSimpleTextContent">
+        <permission-service service-name="contentManagerPermission" main-action="CREATE"/>
         <auto-attributes mode="IN" entity-name="Content" optional="true"/>
         <attribute name="text" type="String" mode="IN" optional="false" allow-html="any"/>
         <override name="contentId" mode="INOUT"/>
     </service>
     <service name="updateSimpleTextContent" engine="simple" location="component://content/minilang/content/ContentServices.xml" invoke="updateSimpleTextContent">
+        <permission-service service-name="contentManagerPermission" main-action="UPDATE"/>
         <attribute name="textDataResourceId" type="String" mode="IN" optional="true"/>
         <attribute name="text" type="String" mode="IN" optional="true" allow-html="any"/>
     </service>
@@ -697,6 +703,7 @@
         location="component://content/minilang/compdoc/CompDocServices.xml"
         invoke="prepForApproval" auth="true">
         <description>Set ContentApprovals for approval process</description>
+        <permission-service service-name="contentManagerPermission" main-action="CREATE"/>
         <attribute name="rootContentId" type="String" mode="IN" optional="false"/>
         <attribute name="rootContentRevisionSeqId" type="String" mode="OUT" optional="false"/>
     </service>

Modified: ofbiz/trunk/applications/marketing/minilang/marketing/contact/ContactListServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/minilang/marketing/contact/ContactListServices.xml?rev=1768188&r1=1768187&r2=1768188&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/minilang/marketing/contact/ContactListServices.xml (original)
+++ ofbiz/trunk/applications/marketing/minilang/marketing/contact/ContactListServices.xml Sat Nov  5 11:10:57 2016
@@ -22,11 +22,6 @@ under the License.
         xmlns="http://ofbiz.apache.org/Simple-Method" xsi:schemaLocation="http://ofbiz.apache.org/Simple-Method http://ofbiz.apache.org/dtds/simple-methods.xsd">
     <!-- ContactList methods -->
     <simple-method method-name="createContactList" short-description="Create an ContactList">
-        <check-permission permission="MARKETING" action="_CREATE">
-            <fail-property resource="MarketingUiLabels.xml" property="MarketingCreatePermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <make-value entity-name="ContactList" value-field="newEntity"/>
         <if-empty field="parameters.contactListId">
             <sequenced-id sequence-name="ContactList" field="newEntity.contactListId"/>

Modified: ofbiz/trunk/applications/marketing/minilang/marketing/tracking/TrackingCodeServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/minilang/marketing/tracking/TrackingCodeServices.xml?rev=1768188&r1=1768187&r2=1768188&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/minilang/marketing/tracking/TrackingCodeServices.xml (original)
+++ ofbiz/trunk/applications/marketing/minilang/marketing/tracking/TrackingCodeServices.xml Sat Nov  5 11:10:57 2016
@@ -22,11 +22,6 @@ under the License.
         xmlns="http://ofbiz.apache.org/Simple-Method" xsi:schemaLocation="http://ofbiz.apache.org/Simple-Method http://ofbiz.apache.org/dtds/simple-methods.xsd">
     <!-- TrackingCodeType methods -->
     <simple-method method-name="createTrackingCodeType" short-description="Create an TrackingCodeType">
-        <check-permission permission="MARKETING" action="_CREATE">
-            <fail-property resource="MarketingUiLabels.xml" property="MarketingCreatePermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <now-timestamp field="nowStamp"/>
 
         <make-value value-field="newEntity" entity-name="TrackingCodeType"/>
@@ -39,11 +34,6 @@ under the License.
         <create-value value-field="newEntity"/>
     </simple-method>
     <simple-method method-name="updateTrackingCodeType" short-description="Update an TrackingCodeType">
-        <check-permission permission="MARKETING" action="_UPDATE">
-            <fail-property resource="MarketingUiLabels.xml" property="MarketingUpdatePermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <now-timestamp field="nowStamp"/>
 
         <make-value entity-name="TrackingCodeType" value-field="lookupPKMap"/>
@@ -54,11 +44,6 @@ under the License.
         <store-value value-field="lookedUpValue"/>
     </simple-method>
     <simple-method method-name="deleteTrackingCodeType" short-description="Delete an TrackingCodeType">
-        <check-permission permission="MARKETING" action="_DELETE">
-            <fail-property resource="MarketingUiLabels.xml" property="MarketingDeletePermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <make-value entity-name="TrackingCodeType" value-field="lookupPKMap"/>
         <set-pk-fields map="parameters" value-field="lookupPKMap"/>
         <find-by-primary-key entity-name="TrackingCodeType" map="lookupPKMap" value-field="lookedUpValue"/>

Added: ofbiz/trunk/applications/marketing/minilang/permission/PermissionServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/minilang/permission/PermissionServices.xml?rev=1768188&view=auto
==============================================================================
--- ofbiz/trunk/applications/marketing/minilang/permission/PermissionServices.xml (added)
+++ ofbiz/trunk/applications/marketing/minilang/permission/PermissionServices.xml Sat Nov  5 11:10:57 2016
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xmlns="http://ofbiz.apache.org/Simple-Method" xsi:schemaLocation="http://ofbiz.apache.org/Simple-Method http://ofbiz.apache.org/dtds/simple-methods.xsd">
+
+    <simple-method method-name="marketingManagerPermission" short-description="Check user has Marketing Manager permission">
+        <set field="primaryPermission" value="MARKETING"/>
+        <call-simple-method method-name="genericBasePermissionCheck" xml-resource="component://common/minilang/permission/CommonPermissionServices.xml"/>
+    </simple-method>
+</simple-methods>

Propchange: ofbiz/trunk/applications/marketing/minilang/permission/PermissionServices.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/marketing/minilang/permission/PermissionServices.xml
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/applications/marketing/minilang/permission/PermissionServices.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: ofbiz/trunk/applications/marketing/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/servicedef/services.xml?rev=1768188&r1=1768187&r2=1768188&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/marketing/servicedef/services.xml Sat Nov  5 11:10:57 2016
@@ -105,6 +105,7 @@ under the License.
     <service name="createContactList" default-entity-name="ContactList" engine="simple"
             location="component://marketing/minilang/marketing/contact/ContactListServices.xml" invoke="createContactList" auth="true">
         <description>Create a ContactList record</description>
+        <permission-service service-name="marketingManagerPermission" main-action="CREATE"/>
         <auto-attributes include="pk" mode="INOUT" optional="true"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
         <override name="contactListTypeId" optional="false"/>
@@ -273,18 +274,21 @@ under the License.
     <service name="createTrackingCodeType" default-entity-name="TrackingCodeType" engine="simple"
             location="component://marketing/minilang/marketing/tracking/TrackingCodeServices.xml" invoke="createTrackingCodeType" auth="true">
         <description>Create a TrackingCodeType record</description>
+        <permission-service service-name="marketingManagerPermission" main-action="CREATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
     <service name="updateTrackingCodeType" default-entity-name="TrackingCodeType" engine="simple"
             location="component://marketing/minilang/marketing/tracking/TrackingCodeServices.xml" invoke="updateTrackingCodeType" auth="true">
         <description>Update a TrackingCodeType record</description>
+        <permission-service service-name="marketingManagerPermission" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
     <service name="deleteTrackingCodeType" default-entity-name="TrackingCodeType" engine="simple"
             location="component://marketing/minilang/marketing/tracking/TrackingCodeServices.xml" invoke="deleteTrackingCodeType" auth="true">
         <description>Update a TrackingCodeType record</description>
+        <permission-service service-name="marketingManagerPermission" main-action="DELETE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>
 
@@ -556,5 +560,10 @@ under the License.
         <description>Delete SegmentGroupType</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>
+    <service name="marketingManagerPermission" engine="simple"
+            location="component://marketing/minilang/permission/PermissionServices.xml" invoke="marketingManagerPermission">
+        <description>Marketing Manager permission Checking Logic</description>
+        <implements service="permissionInterface"/>
+    </service>
 
 </services>

Modified: ofbiz/trunk/applications/order/minilang/order/OrderReturnServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/minilang/order/OrderReturnServices.xml?rev=1768188&r1=1768187&r2=1768188&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/minilang/order/OrderReturnServices.xml (original)
+++ ofbiz/trunk/applications/order/minilang/order/OrderReturnServices.xml Sat Nov  5 11:10:57 2016
@@ -135,9 +135,6 @@ under the License.
         <field-to-result field="responseMessage" result-name="successMessage"/>
     </simple-method>
     <simple-method method-name="updateReturnHeader" short-description="Update a ReturnHeader">
-        <check-permission permission="ORDERMGR" action="_UPDATE"><fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunUpdateReturnHeader"/></check-permission>
-        <check-errors/>
-
         <entity-one entity-name="ReturnHeader" value-field="returnHeader"/>
 
         <!-- test the total return amount vs the total order amount -->
@@ -415,9 +412,6 @@ under the License.
     </simple-method>
 
     <simple-method method-name="updateReturnItem" short-description="Update Return Item">
-        <check-permission permission="ORDERMGR" action="_UPDATE"><fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunUpdateReturnHeader"/></check-permission>
-        <check-errors/>
-
         <set from-field="parameters.returnId" field="lookupPKMap.returnId"/>
         <set from-field="parameters.returnItemSeqId" field="lookupPKMap.returnItemSeqId"/>
         <find-by-primary-key entity-name="ReturnItem" map="lookupPKMap" value-field="returnItem"/>
@@ -445,9 +439,6 @@ under the License.
 
     </simple-method>
     <simple-method method-name="updateReturnItemsStatus" short-description="Update Return Items Status">
-        <check-permission permission="ORDERMGR" action="_UPDATE"><fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunUpdateReturnHeader"/></check-permission>
-        <check-errors/>
-
         <set from-field="parameters.returnId" field="lookupPKMap.returnId"/>
         <find-by-and entity-name="ReturnItem" map="lookupPKMap" list="returnItems"/>
         <iterate entry="item" list="returnItems">
@@ -459,9 +450,6 @@ under the License.
         </iterate>
     </simple-method>
     <simple-method method-name="removeReturnItem" short-description="Remove Return Item">
-        <check-permission permission="ORDERMGR" action="_DELETE"><fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunRemoveQuoteItem"/></check-permission>
-        <check-errors/>
-
         <entity-one entity-name="ReturnHeader" value-field="returnHeader"/>
         <if-compare field="returnHeader.returnHeaderTypeId" operator="equals" value="CUSTOMER_RETURN">
             <if-compare field="returnHeader.statusId" operator="not-equals" type="String" value="RETURN_REQUESTED">
@@ -512,11 +500,6 @@ under the License.
         <field-to-result field="responseMessage" result-name="successMessage"/>
     </simple-method>
     <simple-method method-name="removeReturnAdjustment" short-description="Remove Return Adjustment">
-        <check-permission permission="ORDERMGR" action="_DELETE">
-            <fail-property resource="OrderErrorUiLabels" property="OrderErrorDeletePermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <set from-field="parameters.returnAdjustmentId" field="lookupPKMap.returnAdjustmentId"/>
         <find-by-primary-key entity-name="ReturnAdjustment" map="lookupPKMap" value-field="returnAdjustment"/>
         <if-not-empty field="returnAdjustment">
@@ -525,9 +508,6 @@ under the License.
     </simple-method>
     <!-- note that this service is designed to be called once for each shipment receipt that is created -->
     <simple-method method-name="updateReturnStatusFromReceipt" short-description="Update Return Status From ShipmentReceipt">
-        <check-permission permission="ORDERMGR" action="_UPDATE"><fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunUpdateReturnHeader"/></check-permission>
-        <check-errors/>
-
         <set from-field="parameters.returnId" field="lookupPKMap.returnId"/>
         <find-by-primary-key entity-name="ReturnHeader" map="lookupPKMap" value-field="returnHeader"/>
         <find-by-and entity-name="ShipmentReceipt" map="lookupPKMap" list="shipmentReceipts"/>
@@ -823,8 +803,6 @@ under the License.
     </simple-method>
 
     <simple-method method-name="cancelReturnItems" short-description="Update a ReturnItems">
-        <check-permission permission="ORDERMGR" action="_UPDATE"><fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunCancelReturnItems"/></check-permission>
-        <check-errors/>
         <entity-condition entity-name="ReturnItem" list="returnItems" distinct="true">
             <condition-expr field-name="returnId" operator="equals" from-field="parameters.returnId"/>
         </entity-condition>
@@ -837,8 +815,6 @@ under the License.
     </simple-method>
 
     <simple-method method-name="cancelReplacementOrderItems" short-description="Cancel the associated OrderItems of the replacement order, if any.">
-        <check-permission permission="ORDERMGR" action="_UPDATE"><fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunCancelReturnItems"/></check-permission>
-        <check-errors/>
         <entity-one entity-name="ReturnItem" value-field="returnItem"/>
         <if>
             <condition>
@@ -931,8 +907,6 @@ under the License.
     </simple-method>
 
     <simple-method method-name="createReturnItemShipment" short-description="Create a ReturnItemShipment">
-        <check-permission permission="ORDERMGR" action="_CREATE"><fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunCreateReturnItemShipment"/></check-permission>
-        <check-errors/>
         <make-value value-field="newEntity" entity-name="ReturnItemShipment"/>
         <set-pk-fields map="parameters" value-field="newEntity"/>
         <set-nonpk-fields map="parameters" value-field="newEntity"/>
@@ -1116,11 +1090,6 @@ under the License.
     </simple-method>
     
     <simple-method method-name="updateReturnContactMech" short-description="Update ReturnContactMech">
-        <check-permission permission="ORDERMGR" action="_UPDATE">
-           <fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunUpdateOrderContactMech"/>
-        </check-permission>
-        <check-errors/>
-
         <make-value value-field="returnContactMechMap" entity-name="ReturnContactMech"/>
 
         <set-pk-fields map="parameters" value-field="returnContactMechMap"/>

Added: ofbiz/trunk/applications/order/minilang/permission/PermissionServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/minilang/permission/PermissionServices.xml?rev=1768188&view=auto
==============================================================================
--- ofbiz/trunk/applications/order/minilang/permission/PermissionServices.xml (added)
+++ ofbiz/trunk/applications/order/minilang/permission/PermissionServices.xml Sat Nov  5 11:10:57 2016
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xmlns="http://ofbiz.apache.org/Simple-Method" xsi:schemaLocation="http://ofbiz.apache.org/Simple-Method http://ofbiz.apache.org/dtds/simple-methods.xsd">
+
+    <simple-method method-name="returnPermissionCheck" short-description="Check user has Order return permission">
+        <set field="primaryPermission" value="ORDERMGR"/>
+        <call-simple-method method-name="genericBasePermissionCheck" xml-resource="component://common/minilang/permission/CommonPermissionServices.xml"/>
+    </simple-method>
+</simple-methods>
\ No newline at end of file

Propchange: ofbiz/trunk/applications/order/minilang/permission/PermissionServices.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/order/minilang/permission/PermissionServices.xml
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/applications/order/minilang/permission/PermissionServices.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: ofbiz/trunk/applications/order/ofbiz-component.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/ofbiz-component.xml?rev=1768188&r1=1768187&r2=1768188&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/ofbiz-component.xml (original)
+++ ofbiz/trunk/applications/order/ofbiz-component.xml Sat Nov  5 11:10:57 2016
@@ -53,6 +53,7 @@ under the License.
     <service-resource type="model" loader="main" location="servicedef/services_return.xml"/>
     <service-resource type="model" loader="main" location="servicedef/services_upgrade.xml"/>
     <service-resource type="model" loader="main" location="servicedef/services_checkout.xml"/>
+    <service-resource type="model" loader="main" location="servicedef/services_perm.xml"/>
     <service-resource type="eca" loader="main" location="servicedef/secas.xml"/>
 
     <test-suite loader="main" location="testdef/FinAccountTests.xml"/>

Added: ofbiz/trunk/applications/order/servicedef/services_perm.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services_perm.xml?rev=1768188&view=auto
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/services_perm.xml (added)
+++ ofbiz/trunk/applications/order/servicedef/services_perm.xml Sat Nov  5 11:10:57 2016
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
+    <vendor>OFBiz</vendor>
+    <version>1.0</version>
+
+    <service name="returnPermissionCheck" engine="simple"
+            location="component://order/minilang/permission/PermissionServices.xml" invoke="returnPermissionCheck">
+        <description>Order permission Checking Logic</description>
+        <implements service="permissionInterface"/>
+    </service>
+</services>
\ No newline at end of file

Propchange: ofbiz/trunk/applications/order/servicedef/services_perm.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/order/servicedef/services_perm.xml
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/applications/order/servicedef/services_perm.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: ofbiz/trunk/applications/order/servicedef/services_return.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services_return.xml?rev=1768188&r1=1768187&r2=1768188&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/services_return.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/services_return.xml Sat Nov  5 11:10:57 2016
@@ -44,6 +44,7 @@ under the License.
     <service name="updateReturnHeader" default-entity-name="ReturnHeader" engine="simple"
             location="component://order/minilang/order/OrderReturnServices.xml" invoke="updateReturnHeader">
         <description>Update a ReturnHeader</description>
+        <permission-service service-name="returnPermissionCheck" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
         <attribute name="oldStatusId" type="String" mode="OUT" optional="false"/>
@@ -73,6 +74,7 @@ under the License.
     <service name="updateReturnItem" engine="simple" default-entity-name="ReturnItem"
             location="component://order/minilang/order/OrderReturnServices.xml" invoke="updateReturnItem">
         <description>Update a ReturnItem and related adjustments</description>
+        <permission-service service-name="returnPermissionCheck" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
         <attribute name="oldStatusId" type="String" mode="OUT" optional="false"/>
@@ -80,12 +82,14 @@ under the License.
     <service name="updateReturnItemsStatus" engine="simple"
             location="component://order/minilang/order/OrderReturnServices.xml" invoke="updateReturnItemsStatus">
         <description>Update ReturnItem(s) Status</description>
+        <permission-service service-name="returnPermissionCheck" main-action="UPDATE"/>
         <attribute name="returnId" type="String" mode="IN" optional="false"/>
         <attribute name="statusId" type="String" mode="IN" optional="false"/>
     </service>
     <service name="removeReturnItem" engine="simple"
             location="component://order/minilang/order/OrderReturnServices.xml" invoke="removeReturnItem">
         <description>Remove a ReturnItem and related adjustments</description>
+        <permission-service service-name="returnPermissionCheck" main-action="DELETE"/>
         <auto-attributes entity-name="ReturnItem" include="pk" mode="IN" optional="false"/>
     </service>
     <service name="createReturnItemResponse" engine="entity-auto" invoke="create">
@@ -102,12 +106,14 @@ under the License.
     <service name="cancelReturnItems" engine="simple"
             location="component://order/minilang/order/OrderReturnServices.xml" invoke="cancelReturnItems">
         <description>Cancel ReturnItems and set their status to "RETURN_CANCELLED"</description>
+        <permission-service service-name="returnPermissionCheck" main-action="UPDATE"/>
         <attribute name="returnId" type="String" mode="IN" optional="false"/>
     </service>
 
     <service name="cancelReplacementOrderItems" engine="simple"
             location="component://order/minilang/order/OrderReturnServices.xml" invoke="cancelReplacementOrderItems">
         <description>Cancel the associated OrderItems of the replacement order, if any.</description>
+        <permission-service service-name="returnPermissionCheck" main-action="UPDATE"/>
         <auto-attributes entity-name="ReturnItem" include="pk" mode="IN" optional="false"/>
     </service>
 
@@ -133,6 +139,7 @@ under the License.
     <service name="removeReturnAdjustment" engine="simple" location="component://order/minilang/order/OrderReturnServices.xml"
                  invoke="removeReturnAdjustment">
         <description>Simple remove service</description>
+        <permission-service service-name="returnPermissionCheck" main-action="DELETE"/>
         <auto-attributes entity-name="ReturnAdjustment" include="pk" mode="IN" optional="false"/>
     </service>
     <service name="createReturnAndItemOrAdjustment" engine="simple" location="component://order/minilang/order/OrderReturnServices.xml"
@@ -281,6 +288,7 @@ under the License.
     <service name="updateReturnStatusFromReceipt" engine="simple"
             location="component://order/minilang/order/OrderReturnServices.xml" invoke="updateReturnStatusFromReceipt">
         <description>Update return/item status when items have been received</description>
+        <permission-service service-name="returnPermissionCheck" main-action="UPDATE"/>
         <attribute name="returnId" type="String" mode="IN" optional="false"/>
         <attribute name="returnHeaderStatus" type="String" mode="OUT" optional="false"/>
     </service>
@@ -320,6 +328,7 @@ under the License.
     <service name="createReturnItemShipment" engine="simple"
             location="component://order/minilang/order/OrderReturnServices.xml" invoke="createReturnItemShipment">
         <description>Create a new ReturnItemShipment</description>
+        <permission-service service-name="returnPermissionCheck" main-action="CREATE"/>
         <auto-attributes entity-name="ReturnItemShipment" include="all" mode="IN" optional="false"/>
     </service>
 
@@ -359,6 +368,7 @@ under the License.
     <service name="updateReturnContactMech" engine="simple"
             location="component://order/minilang/order/OrderReturnServices.xml" invoke="updateReturnContactMech" auth="true" default-entity-name="ReturnContactMech">
         <description>Update Return Contact Mech</description>
+        <permission-service service-name="returnPermissionCheck" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <attribute name="oldContactMechId" type="String" mode="IN" optional="true"/>
     </service>

Added: ofbiz/trunk/applications/product/minilang/permission/PermissionServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/minilang/permission/PermissionServices.xml?rev=1768188&view=auto
==============================================================================
--- ofbiz/trunk/applications/product/minilang/permission/PermissionServices.xml (added)
+++ ofbiz/trunk/applications/product/minilang/permission/PermissionServices.xml Sat Nov  5 11:10:57 2016
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xmlns="http://ofbiz.apache.org/Simple-Method" xsi:schemaLocation="http://ofbiz.apache.org/Simple-Method http://ofbiz.apache.org/dtds/simple-methods.xsd">
+
+    <simple-method method-name="facilityManagerPermission" short-description="Check user has facility Manager permission">
+        <set field="primaryPermission" value="FACILITY"/>
+        <call-simple-method method-name="genericBasePermissionCheck" xml-resource="component://common/minilang/permission/CommonPermissionServices.xml"/>
+    </simple-method>
+</simple-methods>

Propchange: ofbiz/trunk/applications/product/minilang/permission/PermissionServices.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/product/minilang/permission/PermissionServices.xml
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/applications/product/minilang/permission/PermissionServices.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: ofbiz/trunk/applications/product/minilang/product/inventory/StockMoveServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/minilang/product/inventory/StockMoveServices.xml?rev=1768188&r1=1768187&r2=1768188&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/minilang/product/inventory/StockMoveServices.xml (original)
+++ ofbiz/trunk/applications/product/minilang/product/inventory/StockMoveServices.xml Sat Nov  5 11:10:57 2016
@@ -27,10 +27,6 @@ under the License.
 
     <simple-method method-name="findStockMovesNeeded" short-description="Find all Stock Moves that need to be done">
         <!-- TODO: make this method aware of serialized inventory in addition to non-serialized inventory -->
-        <check-permission permission="FACILITY" action="_VIEW">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityViewPermissionError"/>
-        </check-permission>
-        <check-errors/>
 
         <!-- First find all OrderItemShipGrpInvRes that are in a FLT_BULK location in the current Facility -->
         <entity-and entity-name="OrderItemShipGrpInvResAndItemLocation" list="orderItemShipGrpInvResAndItemLocationList">
@@ -195,10 +191,6 @@ under the License.
     </simple-method>
     <simple-method method-name="findStockMovesRecommended" short-description="Find all Stock Moves recommended to be done based on ProductFacilityLocation settings">
         <!-- TODO: make this method aware of serialized inventory in addition to non-serialized inventory -->
-        <check-permission permission="FACILITY" action="_VIEW">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityViewPermissionError"/>
-        </check-permission>
-        <check-errors/>
 
         <set field="stockMoveHandled" from-field="parameters.stockMoveHandled"/>
         <set field="productSave.productId" value=""/>

Modified: ofbiz/trunk/applications/product/minilang/product/storage/FacilityContactMechServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/minilang/product/storage/FacilityContactMechServices.xml?rev=1768188&r1=1768187&r2=1768188&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/minilang/product/storage/FacilityContactMechServices.xml (original)
+++ ofbiz/trunk/applications/product/minilang/product/storage/FacilityContactMechServices.xml Sat Nov  5 11:10:57 2016
@@ -21,10 +21,6 @@ under the License.
 <simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://ofbiz.apache.org/Simple-Method" xsi:schemaLocation="http://ofbiz.apache.org/Simple-Method http://ofbiz.apache.org/dtds/simple-methods.xsd">
     <simple-method method-name="createFacilityContactMech" short-description="Create a FacilityContactMech">
-        <check-permission permission="FACILITY" action="_CREATE">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityCreatePermissionError"/>
-        </check-permission>
-        <check-errors/>
         <make-value entity-name="FacilityContactMech" value-field="newValue"/>
         <make-value entity-name="FacilityContactMech" value-field="newFacilityContactMech"/>
         <log level="info" message="contactMechId is ${parameters.contactMechId}"/>
@@ -60,11 +56,6 @@ under the License.
     </simple-method>
 
     <simple-method method-name="updateFacilityContactMech" short-description="Update a FacilityContactMech">
-        <check-permission permission="FACILITY" action="_UPDATE">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityUpdatePermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <make-value entity-name="FacilityContactMech" value-field="newFacilityContactMech"/>
 
         <!-- Find old value -->
@@ -134,11 +125,7 @@ under the License.
 
     <simple-method method-name="deleteFacilityContactMech" short-description="Delete a FacilityContactMech">
         <make-value entity-name="FacilityContactMech" value-field="newFacilityContactMech"/>
-        <check-permission permission="FACILITY" action="_DELETE">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityDeletePermissionError"/>
-        </check-permission>
-        <check-errors/>
-
+        
         <make-value entity-name="FacilityContactMech" value-field="facilityContactMechMap"/>
         <set-pk-fields value-field="facilityContactMechMap" map="parameters"/>
         <find-by-and entity-name="FacilityContactMech" list="facilityContactMechs" map="facilityContactMechMap"/>
@@ -156,11 +143,6 @@ under the License.
     </simple-method>
 
     <simple-method method-name="createFacilityPostalAddress" short-description="Create a PostalAddress for facility">
-        <check-permission permission="FACILITY" action="_CREATE">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityCreatePermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <set-service-fields service-name="createPostalAddress" map="parameters" to-map="createPostalAddressMap"/>
         <call-service in-map-name="createPostalAddressMap" service-name="createPostalAddress">
             <default-message resource="PartyUiLabels" property="PartyPostalAddressSuccessfullyCreated"/>
@@ -181,11 +163,6 @@ under the License.
 
     <simple-method method-name="updateFacilityPostalAddress" short-description="Update a PostalAddress for facility">
         <make-value entity-name="FacilityContactMech" value-field="newFacilityContactMech"/>
-        <check-permission permission="FACILITY" action="_UPDATE">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityUpdatePermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <set-service-fields service-name="updatePostalAddress" map="parameters" to-map="updatePostalAddressMap"/>
         <call-service in-map-name="updatePostalAddressMap" service-name="updatePostalAddress">
             <default-message resource="PartyUiLabels" property="PartyContactMechanismSuccessfullyUpdated"/>
@@ -205,11 +182,6 @@ under the License.
     </simple-method>
 
     <simple-method method-name="createFacilityTelecomNumber" short-description="Create a TelecomNumber for facility">
-        <check-permission permission="FACILITY" action="_CREATE">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityCreatePermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <log level="info" message="Creating telecom number"/>
         <set-service-fields service-name="createTelecomNumber" map="parameters" to-map="createTelecomNumberMap"/>
         <call-service in-map-name="createTelecomNumberMap" service-name="createTelecomNumber">
@@ -230,11 +202,6 @@ under the License.
 
     <simple-method method-name="updateFacilityTelecomNumber" short-description="Update a TelecomNumber for facility">
         <make-value entity-name="FacilityContactMech" value-field="newFacilityContactMech"/>
-        <check-permission permission="FACILITY" action="_UPDATE">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityUpdatePermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <set-service-fields service-name="updateTelecomNumber" map="parameters" to-map="updateTelecomNumberMap"/>
         <call-service service-name="updateTelecomNumber" in-map-name="updateTelecomNumberMap">
             <default-message resource="PartyUiLabels" property="PartyTelecomNumberSuccessfullyUpdated"/>
@@ -256,11 +223,6 @@ under the License.
     </simple-method>
 
     <simple-method method-name="createFacilityEmailAddress" short-description="Create an email address for facility">
-        <check-permission permission="FACILITY" action="_UPDATE">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityUpdatePermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <if-validate-method field="parameters.emailAddress" method="isEmail">
         <else>
             <add-error>
@@ -281,11 +243,6 @@ under the License.
     </simple-method>
 
     <simple-method method-name="updateFacilityEmailAddress" short-description="Update an email address for facility">
-        <check-permission permission="FACILITY" action="_UPDATE">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityUpdatePermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <if-validate-method field="parameters.emailAddress" method="isEmail">
         <else>
             <add-error>
@@ -306,11 +263,6 @@ under the License.
     </simple-method>
 
     <simple-method method-name="createFacilityContactMechPurpose" short-description="Create a facility/contact mech purpose">
-        <check-permission permission="FACILITY" action="_CREATE">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityCreatePermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <make-value value-field="lookUpMap" entity-name="FacilityContactMechPurpose"/>
         <set field="lookUpMap.facilityId" from-field="parameters.facilityId"/>
         <set field="lookUpMap.contactMechId" from-field="parameters.contactMechId"/>
@@ -338,11 +290,6 @@ under the License.
     </simple-method>
 
     <simple-method method-name="deleteFacilityContactMechPurpose" short-description="Delete a facility/contact mech purpose">
-        <check-permission permission="FACILITY" action="_DELETE">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityDeletePermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <make-value value-field="lookUpMap" entity-name="FacilityContactMechPurpose"/>
 
         <set-pk-fields map="parameters" value-field="lookUpMap"/>

Modified: ofbiz/trunk/applications/product/minilang/shipment/picklist/PicklistServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/minilang/shipment/picklist/PicklistServices.xml?rev=1768188&r1=1768187&r2=1768188&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/minilang/shipment/picklist/PicklistServices.xml (original)
+++ ofbiz/trunk/applications/product/minilang/shipment/picklist/PicklistServices.xml Sat Nov  5 11:10:57 2016
@@ -60,10 +60,6 @@ under the License.
          + orderNeedsStockMoveInfoList
         -->
 
-        <check-permission permission="FACILITY" action="_VIEW">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityViewPermissionError"/>
-        </check-permission>
-        <check-errors/>
         <set field="groupByShippingMethod" from-field="parameters.groupByShippingMethod"/>
         <set field="groupByNoOfOrderItems" from-field="parameters.groupByNoOfOrderItems"/>
         <set field="groupByWarehouseArea" from-field="parameters.groupByWarehouseArea"/>
@@ -617,11 +613,6 @@ under the License.
     <!-- ======= Persisted Picklist Maintenance Services ========= -->
     <!-- ========================================================= -->
     <simple-method method-name="createPicklistFromOrders" short-description="Create Picklist From Orders">
-        <check-permission permission="FACILITY" action="_CREATE">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityCreatePermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <now-timestamp field="nowTimestamp"/>
 
         <set-service-fields map="parameters" service-name="findOrdersToPickMove" to-map="findOrdersToPickMoveMap"/>
@@ -772,11 +763,6 @@ under the License.
 
        <!-- Picklist -->
     <simple-method method-name="createPicklist" short-description="Create Picklist">
-        <check-permission permission="FACILITY" action="_CREATE">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityCreatePermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <make-value value-field="newEntity" entity-name="Picklist"/>
         <set-nonpk-fields map="parameters" value-field="newEntity"/>
 
@@ -797,10 +783,6 @@ under the License.
         <create-value value-field="newEntity"/>
     </simple-method>
     <simple-method method-name="updatePicklist" short-description="Update Picklist">
-        <check-permission permission="FACILITY" action="_UPDATE">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityUpdatePermissionError"/>
-        </check-permission>
-
         <make-value value-field="lookupPKMap" entity-name="Picklist"/>
         <set-pk-fields map="parameters" value-field="lookupPKMap"/>
         <find-by-primary-key map="lookupPKMap" value-field="lookedUpValue"/>
@@ -840,11 +822,6 @@ under the License.
         <store-value value-field="lookedUpValue"/>
     </simple-method>
     <simple-method method-name="deletePicklist" short-description="Delete Picklist">
-        <check-permission permission="FACILITY" action="_DELETE">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityDeletePermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <make-value value-field="lookupPKMap" entity-name="Picklist"/>
         <set-pk-fields map="parameters" value-field="lookupPKMap"/>
         <find-by-primary-key map="lookupPKMap" value-field="lookedUpValue"/>
@@ -853,11 +830,6 @@ under the License.
 
     <!-- PicklistBin -->
     <simple-method method-name="createPicklistBin" short-description="Create PicklistBin">
-        <check-permission permission="FACILITY" action="_CREATE">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityCreatePermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <make-value value-field="newEntity" entity-name="PicklistBin"/>
         <set-nonpk-fields map="parameters" value-field="newEntity"/>
 
@@ -867,10 +839,6 @@ under the License.
         <create-value value-field="newEntity"/>
     </simple-method>
     <simple-method method-name="updatePicklistBin" short-description="Update PicklistBin">
-        <check-permission permission="FACILITY" action="_UPDATE">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityUpdatePermissionError"/>
-        </check-permission>
-
         <make-value value-field="lookupPKMap" entity-name="PicklistBin"/>
         <set-pk-fields map="parameters" value-field="lookupPKMap"/>
         <find-by-primary-key map="lookupPKMap" value-field="lookedUpValue"/>
@@ -879,11 +847,6 @@ under the License.
         <store-value value-field="lookedUpValue"/>
     </simple-method>
     <simple-method method-name="deletePicklistBin" short-description="Delete PicklistBin">
-        <check-permission permission="FACILITY" action="_DELETE">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityDeletePermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <make-value value-field="lookupPKMap" entity-name="PicklistBin"/>
         <set-pk-fields map="parameters" value-field="lookupPKMap"/>
         <find-by-primary-key map="lookupPKMap" value-field="lookedUpValue"/>
@@ -892,11 +855,6 @@ under the License.
 
     <!-- PicklistItem -->
     <simple-method method-name="createPicklistItem" short-description="Create PicklistItem">
-        <check-permission permission="FACILITY" action="_CREATE">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityCreatePermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <make-value value-field="newEntity" entity-name="PicklistItem"/>
         <set-pk-fields map="parameters" value-field="newEntity"/>
         <set-nonpk-fields map="parameters" value-field="newEntity"/>
@@ -908,10 +866,6 @@ under the License.
         <create-value value-field="newEntity"/>
     </simple-method>
     <simple-method method-name="updatePicklistItem" short-description="Update PicklistItem">
-        <check-permission permission="FACILITY" action="_UPDATE">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityUpdatePermissionError"/>
-        </check-permission>
-
         <make-value value-field="lookupPKMap" entity-name="PicklistItem"/>
         <set-pk-fields map="parameters" value-field="lookupPKMap"/>
         <find-by-primary-key map="lookupPKMap" value-field="lookedUpValue"/>
@@ -942,11 +896,6 @@ under the License.
         <store-value value-field="lookedUpValue"/>
     </simple-method>
     <simple-method method-name="deletePicklistItem" short-description="Delete PicklistItem">
-        <check-permission permission="FACILITY" action="_DELETE">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityDeletePermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <make-value value-field="lookupPKMap" entity-name="PicklistItem"/>
         <set-pk-fields map="parameters" value-field="lookupPKMap"/>
         <find-by-primary-key map="lookupPKMap" value-field="lookedUpValue"/>
@@ -1154,10 +1103,6 @@ under the License.
     </simple-method>
     
     <simple-method method-name="setPicklistItemToComplete" short-description="Set the status of a pick list item to completed">
-        <check-permission permission="FACILITY" action="_UPDATE">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityUpdatePermissionError"/>
-        </check-permission>
-
         <set-service-fields service-name="updatePicklistItem" map="parameters" to-map="serviceCtx"/>
         <set field="serviceCtx.itemStatusId" value="PICKITEM_COMPLETED"/>
         <call-service service-name="updatePicklistItem" in-map-name="serviceCtx" include-user-login="true"/>
@@ -1165,11 +1110,6 @@ under the License.
 
     <!-- PicklistRole -->
     <simple-method method-name="createPicklistRole" short-description="Create PicklistRole">
-        <check-permission permission="FACILITY" action="_CREATE">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityCreatePermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <make-value value-field="newEntity" entity-name="PicklistRole"/>
         <set-pk-fields map="parameters" value-field="newEntity"/>
         <set-nonpk-fields map="parameters" value-field="newEntity"/>
@@ -1181,10 +1121,6 @@ under the License.
         <create-value value-field="newEntity"/>
     </simple-method>
     <simple-method method-name="updatePicklistRole" short-description="Update PicklistRole">
-        <check-permission permission="FACILITY" action="_UPDATE">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityUpdatePermissionError"/>
-        </check-permission>
-
         <make-value value-field="lookupPKMap" entity-name="PicklistRole"/>
         <set-pk-fields map="parameters" value-field="lookupPKMap"/>
         <find-by-primary-key map="lookupPKMap" value-field="lookedUpValue"/>
@@ -1193,11 +1129,6 @@ under the License.
         <store-value value-field="lookedUpValue"/>
     </simple-method>
     <simple-method method-name="deletePicklistRole" short-description="Delete PicklistRole">
-        <check-permission permission="FACILITY" action="_DELETE">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityDeletePermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <make-value value-field="lookupPKMap" entity-name="PicklistRole"/>
         <set-pk-fields map="parameters" value-field="lookupPKMap"/>
         <find-by-primary-key map="lookupPKMap" value-field="lookedUpValue"/>
@@ -1208,11 +1139,6 @@ under the License.
     <!-- =========== Picklist Report/Display Services ============ -->
     <!-- ========================================================= -->
     <simple-method method-name="getPicklistDisplayInfo" short-description="Get Picklist Display Info">
-        <check-permission permission="FACILITY" action="_VIEW">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityViewPermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <set field="viewSize" from-field="parameters.viewSize" type="Integer"/>
         <set field="viewIndex" from-field="parameters.viewIndex" type="Integer"/>
         <entity-condition entity-name="Picklist" list="picklistList">
@@ -1261,11 +1187,6 @@ under the License.
               2. facilityLocationInfoList (facilityLocation, product, pickQuantity, picklistBinInfoList (picklistBin, quantity), picklistItemInfoList (picklistItem, picklistBin, orderItem, product, inventoryItemAndLocation, orderItemShipGrpInvRes, itemIssuanceList))
               3. noLocationProductInfoList (product, pickQuantity, picklistBinInfoList (picklistBin, quantity), picklistItemInfoList (picklistItem, picklistBin, orderItem, product, inventoryItemAndLocation, orderItemShipGrpInvRes, itemIssuanceList))
         -->
-        <check-permission permission="FACILITY" action="_VIEW">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityViewPermissionError"/>
-        </check-permission>
-        <check-errors/>
-
         <!-- Get the general information for the picklist, this will be used for the pack sheets -->
         <entity-one entity-name="Picklist" value-field="picklist" auto-field-map="true"/>
         <call-simple-method method-name="getPicklistSingleInfoInline"/>
@@ -1644,10 +1565,6 @@ under the License.
 
     <!-- special method to check update the picklist status from the item status -->
     <simple-method method-name="checkPicklistBinItemStatuses" short-description="Checks the item status and updates the pick list status">
-        <check-permission permission="FACILITY" action="_UPDATE">
-            <fail-property resource="ProductUiLabels" property="ProductFacilityUpdatePermissionError"/>
-        </check-permission>
-
         <!-- find the picklist bin -->
         <make-value value-field="binLookup" entity-name="PicklistBin"/>
         <set-pk-fields map="parameters" value-field="binLookup"/>

Modified: ofbiz/trunk/applications/product/ofbiz-component.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/ofbiz-component.xml?rev=1768188&r1=1768187&r2=1768188&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/ofbiz-component.xml (original)
+++ ofbiz/trunk/applications/product/ofbiz-component.xml Sat Nov  5 11:10:57 2016
@@ -59,6 +59,7 @@ under the License.
     <service-resource type="model" loader="main" location="servicedef/services_shipment.xml"/>
     <service-resource type="model" loader="main" location="servicedef/services_store.xml"/>
     <service-resource type="model" loader="main" location="servicedef/services_subscription.xml"/>
+    <service-resource type="model" loader="main" location="servicedef/services_perm.xml"/>
     <service-resource type="model" loader="main" location="servicedef/services_supplier.xml"/>
     <service-resource type="model" loader="main" location="servicedef/services_rental.xml"/>
     <service-resource type="model" loader="main" location="servicedef/services_view.xml"/>