[Zope-CMF] Re: [dev] delete members: small proposal

Yuppie schubbe at web.de
Wed Sep 10 13:40:01 EDT 2003


Hi Chris!


Chris Withers wrote:
> Yuppie wrote:
> 
>>> When you do this, how will you handle ownership issues for the 
>>> various objects owned by the user you're about to delete?
>>
>>
>> I hope someday someone will fix <http://collector.zope.org/CMF/25>, 
>> that would make ownership of content items less important.
> 
> 
> Well, you could always do that now. It's not a big change and would only 
> require a couple of new tests ;-)

As everybody else ;-)

> That said, ownership is ownership, It _should_ be correct regardless of 
> it's importance.

I'll answer that in reply to your second mail (later today).

> [...]
>> 1.) There is no acl_users within the portal:
>> If the User Manager has no permission to delete the member, 
>> deleteMember will do nothing and return 0.
> 
> 
> What's the User Manager?

Should better be spelled user manager. This role isn't defined anywhere. 
It's just the person who is allowed to do things like adding members, 
viewing hidden members and deleting members. In our case the user who 
calls deleteMembers().

> What does 'return 0' do?

I updated my proposal. deleteMembers() returns a tuple listing 
member_ids of deleted members. Your code could test if the return value 
is empty. But maybe deleteMembers() should raise an error instead?

>>> - another type of user folder, such as LDAPUserFolder
>>
>>
>> CMFLDAP has to handle that. CMFCore just works with normal acl_users.
> 
> 
> Well, CMFCore currently works with most userfolders.
> I'd like to see it stay that way... provided deleteMember uses the 
> standard acl_users interfaces, there shouldn't be a problem...

Judging from that interface, userfolders should either have a 
userFolderDelUsers() method or raise 'NotImplemented'. Again my current 
proposal is to return an empty tuple in that case. And again it would be 
possible to raise an error instead.

Currently my implementation looks like this:
<http://cvs.zope.org/CMF/CMFCore/MembershipTool.py.diff?r1=1.38.2.1&r2=1.38.2.2>


Cheers,
	Yuppie





More information about the Zope-CMF mailing list