[Zope-CMF] createMemberarea

Mark McEahern mark@mceahern.com
Tue, 28 Jan 2003 08:11:03 -0600


In CMFCore/MembershipTool.py (1.3 final), the MembershipTool.wrapUser method
calls createMemberarea like this:

  self.createMemberarea(portal_user.getId())

Why not just this:

  self.createMemberarea(portal_user)

We subclassed the MembershipTool and wanted to avoid creating member areas
for all members.  We only want to create members for certain roles.  It
seemed like the most straightforward way to do that would be to override
createMemberarea() and do a test for the user's roles, but the obvious way
to do that:

  # inside createMemberarea:
  member = self.getMemberById(member_id)

leads to infinite recursion since getMemberById() calls wrapUser (which will
end up calling createMemberarea--again)!

Why does wrapUser() call createMemberarea() at all, come to think of it?
It's certainly not obvious, from the name of the method, that it will result
in a folder created in the portal's Member folder for that user.

Just trying to understand.  Any light you can shed would be most
appreciated.

Thanks,

// mark

-