svn commit: r600253 - in /ofbiz/trunk/applications/accounting: script/org/ofbiz/accounting/cost/CostServices.xml script/org/ofbiz/accounting/permissions/PermissionServices.xml servicedef/services_cost.xml

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

svn commit: r600253 - in /ofbiz/trunk/applications/accounting: script/org/ofbiz/accounting/cost/CostServices.xml script/org/ofbiz/accounting/permissions/PermissionServices.xml servicedef/services_cost.xml

adrianc
Author: adrianc
Date: Sat Dec  1 22:43:12 2007
New Revision: 600253

URL: http://svn.apache.org/viewvc?rev=600253&view=rev
Log:
Accounting costs permissions work.

Recommend creating Manufacturing permission service SECA to create manufacturing-specific permissions for the accounting cost services.

Modified:
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/cost/CostServices.xml
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/permissions/PermissionServices.xml
    ofbiz/trunk/applications/accounting/servicedef/services_cost.xml

Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/cost/CostServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/cost/CostServices.xml?rev=600253&r1=600252&r2=600253&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/cost/CostServices.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/cost/CostServices.xml Sat Dec  1 22:43:12 2007
@@ -22,8 +22,6 @@
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
     
     <simple-method method-name="createCostComponentCalc" short-description="Create a CostComponentCalc entry">
-        <check-permission permission="ACCOUNTING" action="_CREATE"><fail-message message="Security Error: to run createCostComponentCalc you must have the ACCOUNTING_CREATE or ACCOUNTING_ADMIN permission"/></check-permission>
-        <check-errors/>
         <make-value entity-name="CostComponentCalc" value-name="newEntity"/>
         <sequenced-id-to-env sequence-name="CostComponentCalc" env-name="costComponentCalcId"/>
         <set from-field="costComponentCalcId" field="newEntity.costComponentCalcId"/>
@@ -32,21 +30,15 @@
         <create-value value-name="newEntity"/>
     </simple-method>
     <simple-method method-name="updateCostComponentCalc" short-description="Update a CostComponentCalc entry">
-        <check-permission permission="ACCOUNTING" action="_CREATE"><fail-message message="Security Error: to run updateCostComponentCalc you must have the ACCOUNTING_CREATE or ACCOUNTING_ADMIN permission"/></check-permission>
-        <check-errors/>
         <entity-one entity-name="CostComponentCalc" value-name="costComponentCalc"/>
         <set-nonpk-fields map-name="parameters" value-name="costComponentCalc"/>
         <store-value value-name="costComponentCalc"/>
     </simple-method>
     <simple-method method-name="removeCostComponentCalc" short-description="Remove a CostComponentCalc entry">
-        <check-permission permission="ACCOUNTING" action="_CREATE"><fail-message message="Security Error: to run removeCostComponentCalc you must have the ACCOUNTING_CREATE or ACCOUNTING_ADMIN permission"/></check-permission>
-        <check-errors/>
         <entity-one entity-name="CostComponentCalc" value-name="costComponentCalc"/>
         <remove-value value-name="costComponentCalc"/>
     </simple-method>
     <simple-method method-name="createWorkEffortCostCalc" short-description="Create a WorkEffortCostCalc entry">
-        <check-permission permission="ACCOUNTING" action="_CREATE"><fail-message message="Security Error: to run createWorkEffortCostCalc you must have the ACCOUNTING_CREATE or ACCOUNTING_ADMIN permission"/></check-permission>
-        <check-errors/>
         <make-value entity-name="WorkEffortCostCalc" value-name="newEntity"/>
         <set-pk-fields map-name="parameters" value-name="newEntity"/>
         <set-nonpk-fields map-name="parameters" value-name="newEntity"/>
@@ -56,8 +48,6 @@
         <create-value value-name="newEntity"/>
     </simple-method>
     <simple-method method-name="removeWorkEffortCostCalc" short-description="Remove a WorkEffortCostCalc entry">
-        <check-permission permission="ACCOUNTING" action="_CREATE"><fail-message message="Security Error: to run removeWorkEffortCostCalc you must have the ACCOUNTING_CREATE or ACCOUNTING_ADMIN permission"/></check-permission>
-        <check-errors/>
         <entity-one entity-name="WorkEffortCostCalc" value-name="workEffortCostCalc"/>
         <remove-value value-name="workEffortCostCalc"/>
     </simple-method>

Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/permissions/PermissionServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/permissions/PermissionServices.xml?rev=600253&r1=600252&r2=600253&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/permissions/PermissionServices.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/permissions/PermissionServices.xml Sat Dec  1 22:43:12 2007
@@ -80,4 +80,9 @@
         <call-simple-method method-name="genericBasePermissionCheck" xml-resource="component://common/script/org/ofbiz/common/permission/CommonPermissionServices.xml"/>
     </simple-method>
 
+    <!-- Returns hasPermission=true if user has one of the base ACCOUNTING CRUD+ADMIN permissions -->
+    <simple-method method-name="acctgCostPermissionCheck" short-description="Accounting cost permission logic">
+        <call-simple-method method-name="basePermissionCheck"/>
+    </simple-method>
+
 </simple-methods>

Modified: ofbiz/trunk/applications/accounting/servicedef/services_cost.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_cost.xml?rev=600253&r1=600252&r2=600253&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/services_cost.xml (original)
+++ ofbiz/trunk/applications/accounting/servicedef/services_cost.xml Sat Dec  1 22:43:12 2007
@@ -27,18 +27,23 @@
     <service name="createCostComponentCalc" default-entity-name="CostComponentCalc" engine="simple"
                 location="org/ofbiz/accounting/cost/CostServices.xml" invoke="createCostComponentCalc" auth="true">
         <description>Create a CostComponentCalc</description>
+        <permission-service service-name="acctgCostPermissionCheck" main-action="CREATE"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
         <auto-attributes include="pk" mode="OUT" optional="true"/>
     </service>
+
     <service name="updateCostComponentCalc" default-entity-name="CostComponentCalc" engine="simple"
                 location="org/ofbiz/accounting/cost/CostServices.xml" invoke="updateCostComponentCalc" auth="true">
         <description>Update a CostComponentCalc</description>
+        <permission-service service-name="acctgCostPermissionCheck" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
+
     <service name="removeCostComponentCalc" default-entity-name="CostComponentCalc" engine="simple"
                 location="org/ofbiz/accounting/cost/CostServices.xml" invoke="removeCostComponentCalc" auth="true">
         <description>Remove a CostComponentCalc</description>
+        <permission-service service-name="acctgCostPermissionCheck" main-action="DELETE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
@@ -46,13 +51,23 @@
     <service name="createWorkEffortCostCalc" default-entity-name="WorkEffortCostCalc" engine="simple"
         location="org/ofbiz/accounting/cost/CostServices.xml" invoke="createWorkEffortCostCalc" auth="true">
         <description>Create a WorkEffortCostCalc entry</description>
+        <permission-service service-name="acctgCostPermissionCheck" main-action="CREATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
         <override name="fromDate" optional="true"/>
     </service>
+
     <service name="removeWorkEffortCostCalc" default-entity-name="WorkEffortCostCalc" engine="simple"
         location="org/ofbiz/accounting/cost/CostServices.xml" invoke="removeWorkEffortCostCalc" auth="true">
         <description>Remove a WorkEffortCostCalc entry</description>
+        <permission-service service-name="acctgCostPermissionCheck" main-action="DELETE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
+    </service>
+
+    <!-- Permission services -->
+    <service name="acctgCostPermissionCheck" engine="simple"
+            location="component://accounting/script/org/ofbiz/accounting/permissions/PermissionServices.xml" invoke="acctgCostPermissionCheck">
+        <description>Accounting Cost Permission Checking Logic</description>
+        <implements service="permissionInterface"/>
     </service>
 </services>