Commit 5f1c2779 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

call 'updateLocalRolesOnDocument()' only if any role exists on the document.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29644 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f7113bcb
...@@ -392,7 +392,12 @@ class ERP5TypeInformation(XMLObject, ...@@ -392,7 +392,12 @@ class ERP5TypeInformation(XMLObject,
# workflow and it is annoyning without security setted # workflow and it is annoyning without security setted
ob.portal_type = self.getId() ob.portal_type = self.getId()
# Here we don't use "if len(self.getFilteredRoleListFor(ob))"
# but use "for role in self.getFilteredRoleListFor(ob)" because
# getFilteredRoleListFor returns a generator.
for role in self.getFilteredRoleListFor(ob):
self.updateLocalRolesOnDocument(ob) self.updateLocalRolesOnDocument(ob)
break
# notify workflow after generating local roles, in order to prevent # notify workflow after generating local roles, in order to prevent
# Unauthorized error on transition's condition # Unauthorized error on transition's condition
......
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