[Zope-CMF] [dev] renaming /Members: a small proposal

Tres Seaver tseaver@zope.com
10 Feb 2003 07:57:17 -0500


On Sun, 2003-02-09 at 06:29, Yuppie wrote:

> I'd prefer to have this on the 'Configuration' tab of portal_membership, 
> there is already the 'setMemberareaCreationFlag' UI. But I don't know if 
> there is a policy to move all settings to portal_properties.

Nope.  Tools are intended to manage their own policy settings.

> 
> A small proposal:
> =================
> 
> I'd like to have this default value in MembershipTool:
> 
>      membersfolder_id = 'Members'

+1
> 
> and add these methods to the portal_membership interface:
> 
>      def setMembersFolder(id='Members'):
>          """ Set the members folder object.
> 
>          The members folder has to be in the same container as the
>          membership tool. id is the id of an existing folder. If id is
>          None, member areas are disabled.
> 
>          Permission -- Manage portal
>          """
> 
>      def getMembersFolder():
>          """ Get the members folder object.
> 
>          If no members folder is set or the set folder id doesn't exist,
>          None is returned.
> 
>          Permission -- Always available
> 
>          Returns -- Members folder object or None
>          """

I wouldn't add this to the "required" interface (in
CMFCore.interfaces.portal_membership), as it represents an API which may
not be present on some implementations of the tool.  The "correct"
location for this would be in CMFDefault.interfaces.portal_membership,
which would then be like:


 from Products.CMFCore.interfaces.portal_membership \
     import MembershipTool as BaseTool

 class MembershipTool( BaseTool ):

     """ Declare product-specific APIs for CMFDefault's tool.
     """
     # your method declarations here;  I would append 'Name' to
     # the accessor / mutator, to clarify that what will be returned
     # is the name of the folder, not the folder object itself.

> If someone wants something more general, he just needs to override these 
>   two methods.

Unless what someone wants is a tool which doesn't allow TTW
modification!  Derived implementations of an interface aren't "plug
compatible" if they need to "cancel" an API defined in the base.

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com