Commit 674e3355 authored by Mame Coumba Sall's avatar Mame Coumba Sall

Rename script that verifies if the user has the permission to modify content

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32016 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ffa2c774
...@@ -53,7 +53,12 @@ ...@@ -53,7 +53,12 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from AccessControl import getSecurityManager\n <value> <string>"""\n
This script is used to determine if the user\n
has the permission "Modify portal content",\n
in the context\n
"""\n
from AccessControl import getSecurityManager\n
u=getSecurityManager().getUser()\n u=getSecurityManager().getUser()\n
if u.has_permission("Modify portal content",context):\n if u.has_permission("Modify portal content",context):\n
return True\n return True\n
...@@ -126,7 +131,7 @@ else:\n ...@@ -126,7 +131,7 @@ else:\n
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Base_getAssignorId</string> </value> <value> <string>Base_userHasModidyPortalContentPermission</string> </value>
</item> </item>
<item> <item>
<key> <string>warnings</string> </key> <key> <string>warnings</string> </key>
......
...@@ -77,7 +77,9 @@ if commission_price is not None:\n ...@@ -77,7 +77,9 @@ if commission_price is not None:\n
quantity = price - commission_value\n quantity = price - commission_value\n
quantity = round(quantity,0)\n quantity = round(quantity,0)\n
if quantity!=context.getQuantity():\n if quantity!=context.getQuantity():\n
if context.Base_getAssignorId()==False and context.getQuantity() is not None:\n #verify that when the quantity is already calculated by another user,it does not need\n
# to be calculated again, just return the value already calculated \n
if context.Base_userHasModidyPortalContentPermission()==False and context.getQuantity() is not None:\n
return quantity\n return quantity\n
else:\n else:\n
context.setQuantity(quantity)\n context.setQuantity(quantity)\n
......
526 527
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment