[Zope-CMF] CopySupport and FSPythonScripts?

seb bacon seb@jamkit.com
Thu, 16 Aug 2001 20:26:09 +0100


* Tres Seaver <tseaver@palladion.com> [010816 18:56]:
> On Thu, 16 Aug 2001, seb bacon wrote:
> > Hooray.  I've worked out how to log someone in programmatically, which
> > is something I've been trying to do occasionally for ages:
> > 
> >             user = self.getMemberById(member_id)
> >             newSecurityManager(None, user)
> > 
> > Simple, but I wonder if there's any security implications of this
> > which I haven't seen?  Hmm, I think I'll post to the zope list too, to
> > see if I get an answer.

> Unless you manage to get the credentials (the cookie) propagated
> back to the browser, your solution won't work beyond the first
> request.  Except for that, it seems fine.

I've just had a small problem which may be related - if you think it
is, it would be good to know.  After having set the user
programmatically, I try to add some content using invokeFactory.  This
ends up trying to index the object, and is choking at the point where
it tries to add the Creator() value to the indices.

Creator() calls Owner.getOwner(), which gets the nearest _owner
attribute via acquisition.  Part of the _owner attribute is a path, in
this case to the MemberDataTool.  And this is where the problem lies,
since the MemberDataTool doesn't provide the getUserById() method
which Owned.getUser() expects to find.

I can fix this easily enough in DublinCore, but I was wondering where
this error came from.  I've only seen this problem where I use my
local user context fix.  Could they be somehow related, or is it a
bug in the Creator() implementation?

thanks for the comments,

seb