Re: Is there an opposite of 'authenticated' in Pyramid?

2011-09-27 Thread Dan Sommers
On Mon, 26 Sep 2011 23:29:07 -0500, Michael Merickel wrote: On Mon, Sep 26, 2011 at 1:36 PM, Benjamin Sims benjamins...@gmail.comwrote: That is, a way to check that a user is not authenticated in order to restrict access to a login form? Restricting access is done via Pyramid's use of

Re: Is there an opposite of 'authenticated' in Pyramid?

2011-09-27 Thread Michael Merickel
On Tue, Sep 27, 2011 at 4:53 AM, Dan Sommers d...@tombstonezero.net wrote: On Mon, 26 Sep 2011 23:29:07 -0500, Michael Merickel wrote: On Mon, Sep 26, 2011 at 1:36 PM, Benjamin Sims benjamins...@gmail.comwrote: How about some combination of the Authenticated principal and DENY:

Is there an opposite of 'authenticated' in Pyramid?

2011-09-26 Thread Benjamin Sims
That is, a way to check that a user is not authenticated in order to restrict access to a login form? I understand that I can do redirects in the view or remove elements in the template depending on whether there is a user set, just wondering if there is a way to do it at the route config level.

Re: Is there an opposite of 'authenticated' in Pyramid?

2011-09-26 Thread Bruce Wade
Append user object to request object. from pyramid.decorator import reify from pyramid.request import Request from pyramid.security import unauthenticated_userid class RequestWithUserAttribute(Request): @reify def user(self): userid = unauthenticated_userid(self) if userid

Re: Is there an opposite of 'authenticated' in Pyramid?

2011-09-26 Thread Michael Merickel
On Mon, Sep 26, 2011 at 1:36 PM, Benjamin Sims benjamins...@gmail.comwrote: That is, a way to check that a user is not authenticated in order to restrict access to a login form? Restricting access is done via Pyramid's use of ACLs (mapping a user's principals to permissions). This means that