[Zope-dev] LoginManager ownership bug!

Jonas Juselius jonas@iki.fi
Fri, 6 Oct 2000 10:32:56 +0300


Cheers!

I actually tried to implement support for local roles in almost exactly the 
same way as you did, but for some reason I didn't get it to work. 
Perhaps I should look into the matter again... I just threw in the 
user_names(), and getUserNames() into the LoginManager, added some dtml to
handle SQL and... it didn't work, so I dropped it... ;-) I'll try to come up
with some nice way to handle local roles in a proper way in the LoginManager,
and hope that I get my patches accepted :-)

Do you have any clue about the ownership bug in the LoginManager? I find it
quite strange that an unowned object becomes owned whenever Zope is restarted
(or when a method is added...). I suspect that the problem is within the
ZPatterns modules, since it handles the persistance of the LoginManager...
This is how the LoginManager is inited and ownership is set:

ob=LoginManager()
ob._owner=UnownableOwner
self._setObject('acl_users', ob)

I tried to make _owner a global attribute of the LoginManager, but that didn't
solve the problem. I have also written Ty Sarna, but I have not received any
response yet.

One more thing... I'm new to PythonMethods, and I would like to know how to
get access to the self attirbute (or the DTML namespace if you like) from
PythonMethods. I would like to use PythonMethods more, beacuse dtml quickly
becomes unreadable and ugly, and Python is always beautiful :-) 

Have a nice day,
                 .jonas.

On Thu, Oct 05, 2000 at 08:11:45AM -0700, Michael Bernstein wrote:
> Jonas Juselius wrote:
> >
> > Another thing which I have tried to do, is to add  support for local roles to
> > the LoginManager. At first it looked rather simple, but then I realized that
> > it wasn't really _that_ simple, and dropped it because I don't have time... It
> > would however be nice to have local roles support in the LoginManager, as it
> > would make it more complete.
> > 
> > I am currently using Zope-2.2.1 (and Zope-2.2.2), ZPatterns-0-4-2a1 and
> > LoginManager-0_8_7a1.
> 
> I used Membership 0.7.6 on top of what you've got, and added
> support for local roles as detailed in this posting:
> 
> http://lists.zope.org/pipermail/zope-dev/2000-September/007030.html
> 
> This ought to give you the clues you need to add the
> neccessary getUserNames method to a SQL User Source, and
> make the LoginManager user_names modification as well. If
> you have any ideas on how to generalize the user_names
> method, I'd like to hear them.
> 
> Let me know how it goes,
> 
> Michael Bernstein.

-- 
	And what is good, Phaedrus,
	And what is not---
	Need we ask anyone to tell us these things?

[ PGP public key: http://www.iki.fi/jonas/pubkey.asc ]