Commit f30f0476 authored by Jérome Perrin's avatar Jérome Perrin

explain strict_* generated related keys in docstring

fix LOG message



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14530 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cb61f47b
...@@ -49,7 +49,7 @@ from MethodObject import Method ...@@ -49,7 +49,7 @@ from MethodObject import Method
from Products.ERP5Security.ERP5UserManager import SUPER_USER from Products.ERP5Security.ERP5UserManager import SUPER_USER
import os, time, urllib, warnings import os, time, urllib, warnings
from zLOG import LOG from zLOG import LOG, PROBLEM
SECURITY_USING_NUX_USER_GROUPS, SECURITY_USING_PAS = range(2) SECURITY_USING_NUX_USER_GROUPS, SECURITY_USING_PAS = range(2)
try: try:
...@@ -710,6 +710,10 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject): ...@@ -710,6 +710,10 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
For exemple it will generate: For exemple it will generate:
destination_title | category,catalog/title/z_related_destination destination_title | category,catalog/title/z_related_destination
default_destination_title | category,catalog/title/z_related_destination default_destination_title | category,catalog/title/z_related_destination
strict_destination_title | category,catalog/title/z_related_strict_destination
strict_ related keys only returns documents which are strictly member of
the category.
""" """
related_key_list = [] related_key_list = []
base_cat_id_list = self.portal_categories.getBaseCategoryDict() base_cat_id_list = self.portal_categories.getBaseCategoryDict()
...@@ -763,20 +767,18 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject): ...@@ -763,20 +767,18 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
(not name.endswith(zope_security))): (not name.endswith(zope_security))):
if name.startswith(STRICT_DYNAMIC_METHOD_NAME): if name.startswith(STRICT_DYNAMIC_METHOD_NAME):
base_category_id = name[len(STRICT_DYNAMIC_METHOD_NAME):] base_category_id = name[len(STRICT_DYNAMIC_METHOD_NAME):]
method = RelatedBaseCategory(base_category_id,strict_membership=1) method = RelatedBaseCategory(base_category_id, strict_membership=1)
else: else:
base_category_id = name[len(DYNAMIC_METHOD_NAME):] base_category_id = name[len(DYNAMIC_METHOD_NAME):]
method = RelatedBaseCategory(base_category_id) method = RelatedBaseCategory(base_category_id)
setattr(self.__class__, name, setattr(self.__class__, name, method)
method)
klass = aq_base(self).__class__ klass = aq_base(self).__class__
if hasattr(klass, 'security'): if hasattr(klass, 'security'):
from Products.ERP5Type import Permissions as ERP5Permissions from Products.ERP5Type import Permissions as ERP5Permissions
klass.security.declareProtected(ERP5Permissions.View, name) klass.security.declareProtected(ERP5Permissions.View, name)
else: else:
# XXX security declaration always failed.... LOG('ERP5Catalog', PROBLEM,
LOG('WARNING ERP5Form SelectionTool, security not defined on', 'Security not defined on %s' % klass.__name__)
0, klass.__name__)
return getattr(self, name) return getattr(self, name)
else: else:
return aq_base_name return aq_base_name
......
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