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

remove useless API.

use searchFolder to search preferences.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4989 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b06d5367
...@@ -53,15 +53,6 @@ class PreferenceTool(BaseTool): ...@@ -53,15 +53,6 @@ class PreferenceTool(BaseTool):
Permissions.ManagePortal, 'manage_overview' ) Permissions.ManagePortal, 'manage_overview' )
manage_overview = DTMLFile( 'explainPreferenceTool', _dtmldir ) manage_overview = DTMLFile( 'explainPreferenceTool', _dtmldir )
security.declareProtected(
Permissions.ManagePortal, 'manage_group_preferences' )
manage_group_preferences = DTMLFile(
'PreferenceTool_managePreferences', _dtmldir )
manage_options = ( BaseTool.manage_options +
( { 'label' : 'User Groups Preferences'
, 'action' : 'manage_group_preferences'},))
security.declarePrivate('manage_afterAdd') security.declarePrivate('manage_afterAdd')
def manage_afterAdd(self, item, container) : def manage_afterAdd(self, item, container) :
""" init the permissions right after creation """ """ init the permissions right after creation """
...@@ -174,12 +165,10 @@ class PreferenceTool(BaseTool): ...@@ -174,12 +165,10 @@ class PreferenceTool(BaseTool):
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 = []
# XXX This will not work with 1000000 users (searchFolder required)
# XXX will also cause problems with Manager (too long) # XXX will also cause problems with Manager (too long)
# XXX Use catalog instead of contentValues (ex. searchFolder)
# XXX For manager, create a manager specific preference # XXX For manager, create a manager specific preference
# or better solution # or better solution
for pref in self.contentValues(spec=('ERP5 Preference', )) : for pref in self.searchFolder(spec=('ERP5 Preference', )) :
pref = pref.getObject() pref = pref.getObject()
if pref.getPreferenceState() == 'enabled' : if pref.getPreferenceState() == 'enabled' :
prefs.append(pref) prefs.append(pref)
...@@ -209,26 +198,5 @@ class PreferenceTool(BaseTool): ...@@ -209,26 +198,5 @@ class PreferenceTool(BaseTool):
acceptable_templates.append (doc) acceptable_templates.append (doc)
return acceptable_templates return acceptable_templates
security.declareProtected(Permissions.ManagePortal,
'USELESS_manage_updateUserGroupsPreferences')
def USELESS_manage_updateUserGroupsPreferences(self, REQUEST) :
""" action edit Users Groups Preferences from the
management sceen
XXX This is not compatible with 1,000,000 preferences
Also, the type of preference (or, better, the priority)
must be *stored* on the preference itself and
set from the preference itself.
This API is therefore useless.
"""
for k, v in REQUEST.items() :
if k.startswith("preference_priority_") :
self[k[len('preference_priority_'):]].setPriority(v)
if REQUEST is not None:
return self.manage_group_preferences( self, REQUEST,
manage_tabs_message='Preference Priorities Updated')
InitializeClass(PreferenceTool) InitializeClass(PreferenceTool)
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