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):
""" return the most appropriate preferences objects,
sorted so that the first in the list should be applied first """
prefs = []
for pref in self.objectValues(spec=('ERP5 Preference', )) :
for pref in self.contentValues(spec=('ERP5 Preference', )) :
pref = pref.getObject()
if pref.getPreferenceState() == 'enabled' and \
self.getPortalObject().portal_membership.\
getAuthenticatedMember().allowed(pref, ['Owner']) :
if pref.getPreferenceState() == 'enabled' :
prefs.append(pref)
prefs.sort(lambda b, a: cmp(a.getPriority(), b.getPriority()))
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