[CMF-checkins] CVS: CMF/CMFCore - ActionsTool.py:1.18 MemberDataTool.py:1.12 PortalFolder.py:1.26 RegistrationTool.py:1.7

Andrew Sawyers andrew@zope.com
Tue, 4 Dec 2001 16:53:45 -0500


Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv18581/CMFCore

Modified Files:
	ActionsTool.py MemberDataTool.py PortalFolder.py 
	RegistrationTool.py 
Log Message:

*tracker #288
*changed ActionsTool listActions to return None
*added listActions method to support moving the actions from
ActionsTool to their respective Tools
*added FTY ids and folder_contents as an action to PortalFolder


=== CMF/CMFCore/ActionsTool.py 1.17 => 1.18 ===
     meta_type = 'CMF Actions Tool'
 
-    action_providers = ( 'portal_actions'
+    action_providers = ( 'portal_memberdata'
+                       , 'portal_registration'
                        , 'portal_discussion'
                        , 'portal_membership'
                        , 'portal_workflow'
@@ -109,6 +110,10 @@
             p_new = p_old + ( provider_name, )
             self.action_providers = p_new
 
+    security.declarePrivate('listActions')
+    def listActions(self, info):
+        return None
+
     security.declareProtected( CMFCorePermissions.ManagePortal
                              , 'deleteActionProvider'
                              )
@@ -222,50 +227,5 @@
     # listFilteredActions() is an alias.
     security.declarePublic('listFilteredActions')
     listFilteredActions = listFilteredActionsFor
-
-    security.declarePrivate('listActions')
-    def listActions(self, info):
-        # This will eventually be configurable through the portal_actions UI.
-        portal_url = info.portal_url
-        if info.isAnonymous:
-            actions = [
-                {'name': 'Log in',
-                 'url': portal_url + '/login_form',
-                 'permissions': [],
-                 'category': 'user'},
-                {'name': 'Join',
-                 'url': portal_url + '/join_form',
-                 'permissions': [CMFCorePermissions.AddPortalMember],
-                 'category': 'user'},
-                ]
-        else:
-            actions = [
-                {'name': 'Preferences',
-                 'url': portal_url + '/personalize_form',
-                 'permissions': [],
-                 'category': 'user'},
-                {'name': 'Log out',
-                 'url': portal_url + '/logout',
-                 'permissions' : [],
-                 'category': 'user'},
-                {'name': 'Reconfigure portal',
-                 'url': portal_url + '/reconfig_form',
-                 'permissions': ['Manage portal'],
-                 'category': 'global'},
-                ]
-
-            folder_url = info.folder_url
-            content_url = info.content_url
-
-            if folder_url is not None:
-                actions.append({
-                    'name': 'Folder contents',
-                    'url': folder_url + '/folder_contents',
-                    'permissions' : ['List folder contents'],
-                    'category': 'folder',
-                    })
-
-        return actions
-
 
 InitializeClass(ActionsTool)


=== CMF/CMFCore/MemberDataTool.py 1.11 => 1.12 ===
     #   'portal_memberdata' interface methods
     #
+    security.declarePrivate('listActions')
+    def listActions(self, info):
+        return None
+
     security.declarePrivate('getMemberDataContents')
     def getMemberDataContents(self):
         '''


=== CMF/CMFCore/PortalFolder.py 1.25 => 1.26 ===
                              , 'immediate_view' : 'folder_edit_form'
                              , 'actions'        :
-                                ( { 'name'          : 'View'
+                                ( { 'id'            : 'view'
+                                  , 'name'          : 'View'
                                   , 'action'        : ''
                                   , 'permissions'   : (View,)
                                   , 'category'      : 'folder'
                                   }
-                                , { 'name'          : 'Edit'
+                                , { 'id'            : 'edit'
+                                  , 'name'          : 'Edit'
                                   , 'action'        : 'folder_edit_form'
                                   , 'permissions'   : (ManageProperties,)
                                   , 'category'      : 'folder'
                                   }
-                                , { 'name'          : 'Local Roles'
+                                , { 'id'            : 'localroles'
+                                  , 'name'          : 'Local Roles'
                                   , 'action'        : 'folder_localrole_form'
                                   , 'permissions'   : (ManageProperties,)
                                   , 'category'      : 'folder'
                                   }
-                                , { 'name'          : 'Syndication'
+                                , { 'id'            : 'syndication'
+                                  , 'name'          : 'Syndication'
                                   , 'action'        : 'synPropertiesForm'
                                   , 'permissions'   : (ManageProperties,)
+                                  , 'category'      : 'folder'
+                                  }
+                                , { 'id'            : 'foldercontents'
+                                  , 'name'          : 'Folder contents'
+                                  , 'action'        : 'folder_contents'
+                                  , 'permissions'   : (CMFCorePermissions.ListFolderContents,)
                                   , 'category'      : 'folder'
                                   }
                                 )


=== CMF/CMFCore/RegistrationTool.py 1.6 => 1.7 ===
     #   'portal_registration' interface methods
     #
+    security.declarePrivate('listActions')
+    def listActions(self, info):
+        return none
+
     security.declarePublic('isRegistrationAllowed')
     def isRegistrationAllowed(self, REQUEST):
         '''Returns a boolean value indicating whether the user