Commit d85d2321 authored by Sebastien Robin's avatar Sebastien Robin

add a parameter to disable the deletion of local roles

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14329 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5feb8a04
......@@ -334,7 +334,7 @@ class BaobabConduit(ERP5Conduit):
portal_type='Organisation',
id=organisation_id
)[0].getObject()
subobject.setCareerSubordinationValue(organisation)
subobject._setCareerSubordinationValue(organisation)
else: # This is an organisation object
site_value = organisation_module_object.Baobab_getSiteFromCodification(
object_id[:3])
......@@ -465,6 +465,8 @@ class BaobabConduit(ERP5Conduit):
, id = object_id
)
if subobject.getPortalType() == 'Person':
subobject.updateLocalRolesOnSecurityGroups()
return subobject
......@@ -1014,3 +1016,10 @@ class BaobabConduit(ERP5Conduit):
resource_url = 'currency_module/%s' % value
resource_value = document.getPortalObject().restrictedTraverse(resource_url)
document.setResourceValue(resource_value)
def newObject(self, object=None, xml=None, simulate=0, reset_local_roles=0):
"""
define it here in order to make sure to not delete security
"""
ERP5Conduit.newObject(self, object=object, xml=xml, simulate=simulate,
reset_local_roles=reset_local_roles)
......@@ -687,7 +687,7 @@ class ERP5Conduit(XMLSyncUtilsMixin):
security.declareProtected(Permissions.ModifyPortalContent, 'newObject')
def newObject(self, object=None, xml=None, simulate=0):
def newObject(self, object=None, xml=None, simulate=0, reset_local_roles=1):
"""
modify the object with datas from
the xml (action section)
......@@ -696,8 +696,9 @@ class ERP5Conduit(XMLSyncUtilsMixin):
if simulate:
return
# Retrieve the list of users with a role and delete default roles
user_role_list = map(lambda x:x[0],object.get_local_roles())
object.manage_delLocalRoles(user_role_list)
if reset_local_roles:
user_role_list = map(lambda x:x[0],object.get_local_roles())
object.manage_delLocalRoles(user_role_list)
if hasattr(object,'workflow_history'):
object.workflow_history = PersistentMapping()
if xml.nodeName.find('xupdate')>= 0:
......
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