Commit 4c7016dc authored by Jérome Perrin's avatar Jérome Perrin

Update allowedRolesAndUsers docstring.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6974 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e0e87b59
...@@ -73,13 +73,14 @@ class IndexableObjectWrapper(CMFCoreIndexableObjectWrapper): ...@@ -73,13 +73,14 @@ class IndexableObjectWrapper(CMFCoreIndexableObjectWrapper):
def allowedRolesAndUsers(self): def allowedRolesAndUsers(self):
""" """
Return a list of roles and users with View permission. Return a list of roles and users with Access contents
information permission.
Used by PortalCatalog to filter out items you're not allowed to see. Used by PortalCatalog to filter out items you're not allowed to see.
""" """
ob = self.__ob ob = self.__ob
allowed = {} allowed = {}
for r in rolesForPermissionOn('Access_contents_information', ob): for r in rolesForPermissionOn('Access_contents_information', ob):
allowed[r] = 1 allowed[r] = 1
if withnuxgroups: if withnuxgroups:
localroles = mergedLocalRoles(ob, withgroups=1) localroles = mergedLocalRoles(ob, withgroups=1)
else: else:
...@@ -104,20 +105,20 @@ class IndexableObjectWrapper(CMFCoreIndexableObjectWrapper): ...@@ -104,20 +105,20 @@ class IndexableObjectWrapper(CMFCoreIndexableObjectWrapper):
new_dict[key] = new_list new_dict[key] = new_list
localroles = new_dict localroles = new_dict
for user, roles in localroles.items(): for user, roles in localroles.items():
for role in roles: for role in roles:
if allowed.has_key(role): if allowed.has_key(role):
if withnuxgroups: if withnuxgroups:
allowed[user] = 1 allowed[user] = 1
else: else:
allowed['user:' + user] = 1 allowed['user:' + user] = 1
# Added for ERP5 project by JP Smets # Added for ERP5 project by JP Smets
if role != 'Owner': if role != 'Owner':
if withnuxgroups: if withnuxgroups:
allowed[user + ':' + role] = 1 allowed[user + ':' + role] = 1
else: else:
allowed['user:' + user + ':' + role] = 1 allowed['user:' + user + ':' + role] = 1
if allowed.has_key('Owner'): if allowed.has_key('Owner'):
del allowed['Owner'] del allowed['Owner']
#LOG("allowedRolesAndUsers",0,str(allowed.keys())) #LOG("allowedRolesAndUsers",0,str(allowed.keys()))
return list(allowed.keys()) return list(allowed.keys())
...@@ -269,8 +270,8 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject): ...@@ -269,8 +270,8 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
for group in groups: for group in groups:
result.append('user:%s' % group) result.append('user:%s' % group)
# end groups # end groups
return result return result
elif withnuxgroups: elif withnuxgroups:
return _getAllowedRolesAndUsers(user) return _getAllowedRolesAndUsers(user)
else: else:
return CMFCoreCatalogTool._listAllowedRolesAndUsers(self, user) return CMFCoreCatalogTool._listAllowedRolesAndUsers(self, user)
...@@ -527,7 +528,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject): ...@@ -527,7 +528,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
return property_dict return property_dict
security.declarePrivate('getDynamicRelatedKeyList') security.declarePrivate('getDynamicRelatedKeyList')
def getDynamicRelatedKeyList(self, sql_catalog_id=None,**kw): def getDynamicRelatedKeyList(self, sql_catalog_id=None, **kw):
""" """
Return the list of dynamic related keys. Return the list of dynamic related keys.
This method will try to automatically generate new related key This method will try to automatically generate new related key
...@@ -537,9 +538,6 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject): ...@@ -537,9 +538,6 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
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
""" """
if len(kw)>0:
# import pdb;pdb.set_trace()
pass
related_key_list = [] related_key_list = []
base_cat_id_list = self.portal_categories.getBaseCategoryList() base_cat_id_list = self.portal_categories.getBaseCategoryList()
default_string = 'default_' default_string = 'default_'
......
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