On Mar 17, 2004, at 5:32 AM, Stefan H. Holek wrote:
> Zachery,
>
> Just at first glance, once you use getId() you can no longer compare
> to the string 'Anonymous User' because this is, well, the user's
> *name*. The anon user has an Id of 'None', IIRC.
Yes, and in the process of fixing my faux pas, I've got the code
modified to this:
if hasattr(object, '__ac_local_roles__'):
if object.__ac_local_roles__ is None:
user=getSecurityManager().getUser()
if user is not None:
id=user.getId()
name=user.getUserName()
if name != 'Anonymous User':
object.manage_setLocalRoles(id, ['Owner'])
Which should still provide for excepting the Anonymous User, but keying
the ownership to the Id.
I'll write some tests as soon as I get to work, and get them all
checked in.
Zac