Commit 948cc480 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Get portal_membership from a portal object for optimization.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37694 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b66863d5
...@@ -778,7 +778,7 @@ class CategoryTool( UniqueObject, Folder, Base ): ...@@ -778,7 +778,7 @@ class CategoryTool( UniqueObject, Folder, Base ):
# Build the ckecked_permission filter # Build the ckecked_permission filter
if checked_permission is not None: if checked_permission is not None:
checkPermission = self.portal_membership.checkPermission checkPermission = self.getPortalObject().portal_membership.checkPermission
def permissionFilter(category): def permissionFilter(category):
object = self.unrestrictedTraverse(category) # XXX Why unrestrictedTraverse and not resolveCategory ? object = self.unrestrictedTraverse(category) # XXX Why unrestrictedTraverse and not resolveCategory ?
if object is not None and checkPermission(checked_permission, object): if object is not None and checkPermission(checked_permission, object):
...@@ -872,7 +872,7 @@ class CategoryTool( UniqueObject, Folder, Base ): ...@@ -872,7 +872,7 @@ class CategoryTool( UniqueObject, Folder, Base ):
""" """
if permission is None: if permission is None:
return category_list return category_list
checkPermission = self.portal_membership.checkPermission checkPermission = self.getPortalObject().portal_membership.checkPermission
resolveCategory = self.resolveCategory resolveCategory = self.resolveCategory
new_category_list = [] new_category_list = []
append = new_category_list.append append = new_category_list.append
......
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