[Zope-CMF] Re: [dev] delete members: related changes and updated proposal

Yuppie schubbe at web.de
Tue Sep 16 04:45:43 EDT 2003


Hi!


J Cameron Cooper wrote:
> 
>> portal_membership:
>>
>> def deleteMembers(member_ids, delete_memberareas=1,
>>                    delete_localroles=1):
>>   """ Delete members specified by member_ids.
>>
>>   Delete members in acl_users and member data in portal_memberdata.
>>   If delete_memberareas is true, delete members' home folders including
>>   all content items. If delete_localroles is true, recursively delete
>>   members' local roles, starting from the portal root.
>>
>>   Permission -- Manage users
>>
>>   Returns -- Tuple listing member_ids of deleted members
> 
> 
> While the idea that this method should delete the folders by default is 
> fine and expected, it seems strange to have flags that default to true. 
> If it's a "hidden" option, one should turn it on, rather than off, when 
> over-riding. How about:
> 
> def deleteMembers(member_ids, keep_memberareas=0,
>                   keep_localroles=0):

Strange! There are some methods in CMF using true as default and it 
never seemed strange to me:

     def registerDirectory(self, name, _prefix, subdirs=1):
     def registerDirectoryByPath(self, filepath, subdirs=1):
     def _verifyObjectPaste(self, object, validate_src=1):
     def __init__(self, method, id=None, reindex=1):
     def setLocalRoles( self, obj, member_ids, member_role, reindex=1 ):
     def deleteLocalRoles( self, obj, member_ids, reindex=1 ):

keep_memberareas and keep_localroles would work, but how would you 
change these flags?

     subdirs      -> ignore_subdirs ?
     validate_src -> don_t_care_if_src_is_valid ?
     reindex      -> keep_index_untouched ?

Well. I could live with your proposal, but if there are no other people 
supporting your position, I'd like to stick to the way I did it:

true  := active (delete, index, validate, ...)
false := passive (keep, ignore, ...)


Cheers,
	Yuppie





More information about the Zope-CMF mailing list