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

Yuppie schubbe@web.de
Mon, 23 Jun 2003 19:27:25 +0200


Hi Florent!


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.

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.


>>             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!


Cheers,

Yuppie