Author: mor
Date: Sat Apr  3 17:58:06 2010
New Revision: 930551

URL: http://svn.apache.org/viewvc?rev=930551&view=rev
Log:
In the service def. replaced <check-permission> with <permission-service> tag 
such that a permission checking is done using a permission 
service. Also moved the permission checking logic to service definition.

Modified:
    
ofbiz/trunk/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml
    ofbiz/trunk/applications/product/servicedef/services_shipment.xml

Modified: 
ofbiz/trunk/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml?rev=930551&r1=930550&r2=930551&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml
 (original)
+++ 
ofbiz/trunk/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml
 Sat Apr  3 17:58:06 2010
@@ -21,9 +21,6 @@ under the License.
 <simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
         
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd";>
     <simple-method method-name="createShipmentReceipt" 
short-description="Create a ShipmentReceipt">
-        <check-permission permission="FACILITY" action="_CREATE"><fail-message 
message="Security Error: to run createShipmentReceipt you must have the 
FACILITY_CREATE or FACILITY_ADMIN permission"/></check-permission>
-        <check-errors/>
-
         <make-value value-field="newEntity" entity-name="ShipmentReceipt"/>
         <set-nonpk-fields map="parameters" value-field="newEntity"/>
 
@@ -51,9 +48,6 @@ under the License.
     </simple-method>
 
     <simple-method method-name="createShipmentReceiptRole" 
short-description="Create a ShipmentReceipt Role">
-        <check-permission permission="FACILITY" action="_CREATE"><fail-message 
message="Security Error: to run createShipmentReceiptRole you must have the 
FACILITY_CREATE or FACILITY_ADMIN permission"/></check-permission>
-        <check-errors/>
-
         <make-value value-field="newEntity" entity-name="ShipmentReceiptRole"/>
         <set-pk-fields map="parameters" value-field="newEntity"/>
         <set-nonpk-fields map="parameters" value-field="newEntity"/>
@@ -62,9 +56,6 @@ under the License.
     </simple-method>
 
     <simple-method method-name="removeShipmentReceiptRole" 
short-description="Remove a ShipmentReceipt Role">
-        <check-permission permission="FACILITY" action="_DELETE"><fail-message 
message="Security Error: to run removeShipmentReceiptRole you must have the 
FACILITY_DELETE or FACILITY_ADMIN permission"/></check-permission>
-        <check-errors/>
-
         <make-value value-field="lookupPKMap" 
entity-name="ShipmentReceiptRole"/>
         <set-pk-fields map="parameters" value-field="lookupPKMap"/>
         <find-by-primary-key entity-name="ShipmentReceiptRole" 
map="lookupPKMap" value-field="lookedUpValue"/>
@@ -72,9 +63,6 @@ under the License.
     </simple-method>
 
     <simple-method method-name="receiveInventoryProduct" 
short-description="Receive Inventory in new Inventory Item(s)">
-        <check-permission permission="FACILITY" action="_CREATE"><fail-message 
message="Security Error: to run receiveInventoryProduct you must have the 
FACILITY_CREATE or FACILITY_ADMIN permission"/></check-permission>
-        <check-errors/>
-
         <!-- NOTES
             - for serialized items with a serial number passed in: the 
quantityAccepted _should_ always be 1
             - if the type is SERIALIZED_INV_ITEM but there is not serial 
number (which is weird...) we'll create a bunch of individual InventoryItems
@@ -188,9 +176,6 @@ under the License.
     </simple-method>
 
     <simple-method method-name="quickReceiveReturn" short-description="Quick 
Receive Entire Return">
-        <check-permission permission="FACILITY" action="_CREATE"><fail-message 
message="Security Error: to run quickReceiveReturn you must have the 
FACILITY_CREATE or FACILITY_ADMIN permission"/></check-permission>
-        <check-errors/>
-
         <entity-one entity-name="ReturnHeader" value-field="returnHeader">
             <field-map field-name="returnId" from-field="parameters.returnId"/>
         </entity-one>
@@ -316,12 +301,6 @@ under the License.
     
     <simple-method method-name="issueOrderItemToShipmentAndReceiveAgainstPO" 
short-description="Issues order item quantity specified to the shipment, then 
receives inventory for that item and quantity">
         <set value="Issue OrderItem to Shipment and Receive against PO" 
field="operationName"/>
-        <check-permission permission="FACILITY" action="_CREATE">
-            <fail-message message="Security Error: to run ${operationName} you 
must have the FACILITY_CREATE or FACILITY_ADMIN permission"/>
-        </check-permission>
-        <check-permission permission="FACILITY" action="_UPDATE">
-            <fail-message message="Security Error: to run ${operationName} you 
must have the FACILITY_UPDATE or FACILITY_ADMIN permission"/>
-        </check-permission>
         <call-simple-method method-name="checkCanChangeShipmentStatusPacked" 
xml-resource="component://product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml"/>
 
         <!-- get orderItem -->

Modified: ofbiz/trunk/applications/product/servicedef/services_shipment.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_shipment.xml?rev=930551&r1=930550&r2=930551&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/services_shipment.xml (original)
+++ ofbiz/trunk/applications/product/servicedef/services_shipment.xml Sat Apr  
3 17:58:06 2010
@@ -103,18 +103,14 @@ under the License.
     <service name="createShipmentForReturn" default-entity-name="ReturnHeader" 
engine="simple"
             
location="component://product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml"
 invoke="createShipmentForReturn">
         <description>Create a Return Shipment with information from 
ReturnHeader fields</description>
-        <required-permissions join-type="AND">
-            <check-permission permission="FACILITY" action="_CREATE"/>
-        </required-permissions>
+        <permission-service service-name="facilityGenericPermission" 
main-action="CREATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <attribute name="shipmentId" type="String" mode="OUT" 
optional="false"/>
     </service>
     <service name="createShipmentAndItemsForReturn" 
default-entity-name="ReturnHeader" engine="simple"
             
location="component://product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml"
 invoke="createShipmentAndItemsForReturn">
         <description>Create a Return Shipment and ShipmentItems with 
information from ReturnHeader and ReturnItems</description>
-        <required-permissions join-type="AND">
-            <check-permission permission="FACILITY" action="_CREATE"/>
-        </required-permissions>
+        <permission-service service-name="facilityGenericPermission" 
main-action="CREATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <attribute name="shipmentId" type="String" mode="OUT" 
optional="false"/>
     </service>
@@ -122,9 +118,7 @@ under the License.
     <service name="createShipmentAndItemsForVendorReturn" 
default-entity-name="Shipment" engine="simple"
             
location="component://product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml"
 invoke="createShipmentAndItemsForVendorReturn">
         <description>Create a Return Shipment and ShipmentItems with 
primaryReturnId</description>
-        <required-permissions join-type="AND">
-            <check-permission permission="FACILITY" action="_CREATE"/>
-        </required-permissions>
+        <permission-service service-name="facilityGenericPermission" 
main-action="CREATE"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
         <attribute name="shipmentId" type="String" mode="OUT" 
optional="false"/>
         <override name="primaryReturnId" optional="false"/>
@@ -733,6 +727,7 @@ under the License.
     <service name="createShipmentReceipt" engine="simple"
             
location="component://product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml"
 invoke="createShipmentReceipt" auth="true">
         <description>Creates a ShipmentReceipt Record</description>
+        <permission-service service-name="facilityGenericPermission" 
main-action="CREATE"/>
         <implements service="interfaceShipmentReceipt"/>
         <attribute name="receiptId" type="String" mode="OUT" optional="false"/>
     </service>
@@ -751,6 +746,7 @@ under the License.
     <service name="receiveInventoryProduct" engine="simple" 
transaction-timeout="600"
             
location="component://product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml"
 invoke="receiveInventoryProduct" auth="true">
         <description>Receive Inventory In Warehouse</description>
+        <permission-service service-name="facilityGenericPermission" 
main-action="CREATE"/>
         <auto-attributes entity-name="InventoryItem" include="nonpk" mode="IN" 
optional="true">
             <exclude field-name="availableToPromiseTotal"/>
             <exclude field-name="quantityOnHandTotal"/>
@@ -773,12 +769,17 @@ under the License.
     <service name="issueOrderItemToShipmentAndReceiveAgainstPO" 
engine="simple" transaction-timeout="600"
             
location="component://product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml"
 invoke="issueOrderItemToShipmentAndReceiveAgainstPO" auth="true">
         <description>Issues order item quantity specified to the shipment, 
then receives inventory for that item and quantity</description>
+        <required-permissions join-type="AND">
+            <permission-service service-name="facilityGenericPermission" 
main-action="CREATE"/>
+            <permission-service service-name="facilityGenericPermission" 
main-action="UPDATE"/>
+        </required-permissions>
         <implements service="issueOrderItemToShipment"/>
         <implements service="receiveInventoryProduct"/>
     </service>
 
     <service name="quickReceiveReturn" engine="simple"
             
location="component://product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml"
 invoke="quickReceiveReturn" auth="true">
+        <permission-service service-name="facilityGenericPermission" 
main-action="CREATE"/>
         <attribute name="returnId" type="String" mode="IN" optional="false"/>
         <attribute name="inventoryItemTypeId" type="String" mode="IN" 
optional="true"/>
         <attribute name="statusId" type="String" mode="IN" optional="true"/>
@@ -793,11 +794,13 @@ under the License.
     <service name="createShipmentReceiptRole" engine="simple"
             
location="component://product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml"
 invoke="createShipmentReceiptRole" auth="true">
         <description>Create a ShipmentReceipt Role entry</description>
+        <permission-service service-name="facilityGenericPermission" 
main-action="CREATE"/>
         <implements service="interfaceShipmentReceiptRole"/>
     </service>
     <service name="removeShipmentReceiptRole" engine="simple"
             
location="component://product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml"
 invoke="removeShipmentReceiptRole" auth="true">
         <description>Remove a ShipmentReceipt Role entry</description>
+        <permission-service service-name="facilityGenericPermission" 
main-action="DELETE"/>
         <implements service="interfaceShipmentReceiptRole"/>
     </service>
 


Reply via email to