Re: [Zope-dev] Subclassing LoginManager

2000-05-23 Thread Dan L. Pierson

Phillip J. Eby writes:
 > At 04:37 PM 5/22/00 -0400, Dan L. Pierson wrote:
 > >Never mind.  I found the bug of mine.
 > 
 > What was it?  I saw your question and this answer at the same time, and now
 > I'm curious.  :)

When I copied the code that canonicalizes user roles and domains from
GenericUserSource, I forgot to add an 'import types'.  Fortunately
the copied code did a good job of catching exceptions and setting the
roles to ['Anonymous'] :-)

Patch follows in next message.


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Subclassing LoginManager

2000-05-22 Thread Phillip J. Eby

At 04:37 PM 5/22/00 -0400, Dan L. Pierson wrote:
>Never mind.  I found the bug of mine.

What was it?  I saw your question and this answer at the same time, and now
I'm curious.  :)


>I now hope to get a PTK/LoginManager patch out tomorrow.

Fantastic.  I really hope to actually have time to *look* at the PTK again
some week soon.  :)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Subclassing LoginManager

2000-05-22 Thread Dan L. Pierson

Never mind.  I found the bug of mine.

I now hope to get a PTK/LoginManager patch out tomorrow.

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Subclassing LoginManager

2000-05-22 Thread Dan L. Pierson

Phillip J. Eby writes:
 > LoginManager will behave just like your outline, if you give it a
 > BasicCookie LoginMethod, and a BasicAuth LoginMethod, in that order.
 > LoginManager does not climb up the acquisition hierarchy, as that is
 > properly the province of ZPublisher to do.  It will provide the anonymous
 > user, if it is a top-level user folder.

You're right if course.  I just didn't realize that the PTK was set up 
to require cookie logins, so I was trying to avoid them and solve the
simpler piece of the problem first :-(

Oh well, that's working fine now.  I can log in, but it looks like
permissions aren't getting set/propagated correctly:

The initial management user is created with roles: 

   ['Member', 'Manager', 'Reviewer']

My PersistentUserSource returns this list correctly as the roles list.
All of the following are in Zope 2.1.6:

1. If I create the Portal as superuser with the Portal manager having the
same username as me, then log in to the portal in a new browser I can
see my folder but don't even have the permission to create new objects
in it.

2. If I create the Portal as me, a site Manager, with the Portal manager
having my user name, then log in as above, I can create objects but
clearly don't have Reviewer rights.

3. If I create the Portal as me with the Portal manager having another
username, then log in as above, it's just like the first case.  I can
see my folder but can't create anything in it.

Any idea what I'm doing wrong now?

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Subclassing LoginManager

2000-05-19 Thread Phillip J. Eby

At 06:02 PM 5/19/00 -0400, Dan L. Pierson wrote:
>LoginManager.LoginManager.validate.  A rough sketch is like this:
>
>if req_has('__ac'):
>... handle cookie login ...
>
>if req_has('__ac_name') and req_has('__ac_password'):
>... handle explicit login ...
>
>if auth and lower(auth[:6]) != 'basic': 
>... do basic authentication ...
>
>... climb up the acquisition hierarchy ...
>
>... try anonymous ...

LoginManager will behave just like your outline, if you give it a
BasicCookie LoginMethod, and a BasicAuth LoginMethod, in that order.
LoginManager does not climb up the acquisition hierarchy, as that is
properly the province of ZPublisher to do.  It will provide the anonymous
user, if it is a top-level user folder.


>I know that the official way to do most of this sort of thing with
>LoginManager is by defining new LoginMethods, but I just don't see how 
>to make LoginManager even try the LoginMethods at the correct time
>without overriding validate.
>
>Am I on the right track here?

Not as far as I can see.  You shouldn't even need any custom LoginMethods,
the out-of-the-box ones should work just fine.


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )