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

use catalog to iterate on preference list, preventing Unauthorized access


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3876 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 11edd11c
...@@ -144,11 +144,9 @@ class PreferenceTool(BaseTool): ...@@ -144,11 +144,9 @@ class PreferenceTool(BaseTool):
""" return the most appropriate preferences objects, """ return the most appropriate preferences objects,
sorted so that the first in the list should be applied first """ sorted so that the first in the list should be applied first """
prefs = [] prefs = []
for pref in self.objectValues(spec=('ERP5 Preference', )) : for pref in self.contentValues(spec=('ERP5 Preference', )) :
pref = pref.getObject() pref = pref.getObject()
if pref.getPreferenceState() == 'enabled' and \ if pref.getPreferenceState() == 'enabled' :
self.getPortalObject().portal_membership.\
getAuthenticatedMember().allowed(pref, ['Owner']) :
prefs.append(pref) prefs.append(pref)
prefs.sort(lambda b, a: cmp(a.getPriority(), b.getPriority())) prefs.sort(lambda b, a: cmp(a.getPriority(), b.getPriority()))
return prefs return prefs
......
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