svn commit: r686595 - in /ofbiz/trunk/applications/party: data/PartySecurityData.xml script/org/ofbiz/party/party/PartyPermissionServices.xml

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

svn commit: r686595 - in /ofbiz/trunk/applications/party: data/PartySecurityData.xml script/org/ofbiz/party/party/PartyPermissionServices.xml

hansbak-2
Author: hansbak
Date: Sun Aug 17 02:16:38 2008
New Revision: 686595

URL: http://svn.apache.org/viewvc?rev=686595&view=rev
Log:
refinement security for creating external email and internal comm notes

Modified:
    ofbiz/trunk/applications/party/data/PartySecurityData.xml
    ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyPermissionServices.xml

Modified: ofbiz/trunk/applications/party/data/PartySecurityData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/data/PartySecurityData.xml?rev=686595&r1=686594&r2=686595&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/data/PartySecurityData.xml (original)
+++ ofbiz/trunk/applications/party/data/PartySecurityData.xml Sun Aug 17 02:16:38 2008
@@ -40,9 +40,11 @@
     <SecurityPermission description="Create party quals in the Party Manager." permissionId="PARTYMGR_QAL_CREATE"/>
     <SecurityPermission description="Update party quals in the Party Manager." permissionId="PARTYMGR_QAL_UPDATE"/>
     <SecurityPermission description="Delete party quals in the Party Manager." permissionId="PARTYMGR_QAL_DELETE"/>
-    <SecurityPermission description="Create communication event." permissionId="PARTYMGR_CME_CREATE"/>
-    <SecurityPermission description="Update communication event." permissionId="PARTYMGR_CME_UPDATE"/>
-    <SecurityPermission description="Delete communication event." permissionId="PARTYMGR_CME_DELETE"/>
+    <SecurityPermission description="Create communication event, any from/to party." permissionId="PARTYMGR_CME_CREATE"/>
+    <SecurityPermission description="Update communication event, any from/to party." permissionId="PARTYMGR_CME_UPDATE"/>
+    <SecurityPermission description="Delete communication event, any from/to party." permissionId="PARTYMGR_CME_DELETE"/>
+    <SecurityPermission description="Can create Email communication events for logged-in user." permissionId="PARTYMGR_CME-EMAIL_CREATE"/>
+    <SecurityPermission description="Can create Internal note communication event for logged-in user." permissionId="PARTYMGR_COM-NOTE_CREATE"/>
 
     <SecurityGroup description="Party Admin group, has all party permissions." groupId="PARTYADMIN"/>
     <SecurityGroupPermission groupId="PARTYADMIN" permissionId="PARTYMGR_ADMIN"/>

Modified: ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyPermissionServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyPermissionServices.xml?rev=686595&r1=686594&r2=686595&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyPermissionServices.xml (original)
+++ ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyPermissionServices.xml Sun Aug 17 02:16:38 2008
@@ -242,15 +242,39 @@
         <if>
             <condition>
                 <and>
-                    <if-compare-field field="parameters.partyIdFrom" to-field="userLogin.partyId" operator="not-equals"/>
-                    <if-compare-field field="parameters.partyIdTo" to-field="userLogin.partyId" operator="not-equals"/>
-                    <if-compare-field field="parameters.partyId" to-field="userLogin.partyId" operator="not-equals"/><!-- update role -->
+                    <if-compare operator="equals" value="EMAIL_COMMUNICATION" field="parameters.communicationEventTypeId"/>
+                    <if-compare operator="equals" value="CREATE" field="action"/>
                 </and>
             </condition>
             <then>
-                <set field="altPermission" value="PARTYMGR_CME"/>
+                <set field="altPermission" value="PARTYMGR_CME-EMAIL"/>
                 <call-simple-method method-name="basePermissionCheck"/>
             </then>
+            <else-if>
+            <condition>
+                <and>
+                    <if-compare operator="equals" value="COMMENT_NOTE" field="parameters.communicationEventTypeId"/>
+                    <if-compare operator="equals" value="CREATE" field="action"/>
+                </and>
+            </condition>
+            <then>
+                <set field="altPermission" value="PARTYMGR_CME-NOTE"/>
+                <call-simple-method method-name="basePermissionCheck"/>
+            </then>
+            </else-if>
+            <else-if>
+            <condition>
+                <and>
+                    <if-compare-field field="parameters.partyIdFrom" to-field="userLogin.partyId" operator="not-equals"/>
+                    <if-compare-field field="parameters.partyIdTo" to-field="userLogin.partyId" operator="not-equals"/>
+                    <if-compare-field field="parameters.partyId" to-field="userLogin.partyId" operator="not-equals"/><!-- update role -->
+                </and>
+            </condition>
+            <then>
+                <set field="altPermission" value="PARTYMGR_CME"/>
+                <call-simple-method method-name="basePermissionCheck"/>
+            </then>
+            </else-if>
             <else>
                 <set field="hasPermission" type="Boolean" value="true"/>
                 <field-to-result field-name="hasPermission"/>