[Zope-CMF] Re: [CMF-checkins] CVS: CMF/CMFDefault - MembershipTool.py:1.35.2.1

Florent Guillaume fg@nuxeo.com
23 Jun 2003 20:15:11 +0200


Hi,

On Mon, 2003-06-23 at 19:27, Yuppie wrote:
> Florent Guillaume wrote:
> >>+        # Note: We can't use getAuthenticatedMember() and getMemberById()
> >>+        # because they might be wrapped by MemberDataTool.
> > 
> > Why is that a problem ?
> 
> changeOwnership() doesn't work with full wrapped users, because the path 
> of these users points to the MemberDataTool and not to acl_users.

That's if you use a member (=wrapped user), but member.getUser() should
return a normal user object whose acquisition path is correct, and you
can use that.

> If we would hide Ownership completely from the portal user, there would 
> be no need at all to change Ownership. Changing Ownership is also an 
> unresolved issue with the new createMemberContent hook.
> 
> See also <http://collector.zope.org/CMF/25>
> 
> >>+        # Note: We can't use invokeFactory() to add folder and content because
> >>+        # the user might not have the necessary permissions.
> >>+
> >>+        # Create Member's home folder.
> >>+        members.manage_addPortalFolder(id=member_id,
> >>+                                       title="%s's Home" % member_id)
> >>+        f = getattr(members, member_id)
> > 
> > 
> > It would be nice if the portal type of the folder was customizable too.
> > And properly in the workflows. I know I need this for CPS. This would
> 
> +0
> 
> I think in the long run, CMFDefault MembershipTool should inherit 
> createMemberarea() from CMFCore. Right now there is a lot of redundant code.
> 
> That would mean:
> 
> - adding getMembersFolder() to CMFCore MembershipTool
> (Tres did want to have this only in CMFDefault, but maybe he could live 
> with a hardcoded getMembersFolder method in CMFCore)
> 
> - if there is no createMemberContent script, createMemberarea() has to 
> do the same as the old CMFCore createMemberarea() did.
> (I didn't make the folder customizable to keep this in sync)
> 
> I think createMemberarea() should always create a Memberarea, but maybe 
> there is a good solution to make this customizable.
> As a workaround, you can delete the default Folder and add another using 
> the script.

Hmmm, right, I think in CPS we need to subclass the membership tool in
any case so we can do whatever we want.

> >>             f.index_html._setPortalTypeName( 'Document' )
> >>-
> >>-            # Overcome an apparent catalog bug.
> >>             f.index_html.reindexObject()
> >>-            wftool = getToolByName( f, 'portal_workflow' )
> >>-            wftool.notifyCreated( f.index_html )
> >>+            f.index_html.notifyWorkflowCreated()
> > 
> > 
> > God this is ugly, we shouldn't have to do TypesTool's work here either.
> > I hope I can work on it.
> 
> +1
> 
> Would be great!

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:fg@nuxeo.com