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
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:
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.
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
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