[web2py] Re: Does auth.requires() always requires login?

2011-10-18 Thread Massimo Di Pierro
True. It also allowed to simplify the logic of the other decorators since now they all call auth.requires(...) and this limited some duplication of code. On Oct 18, 11:57 am, "Ray (a.k.a. Iceberg)" wrote: > Thanks Massimo and everyone took part in this thread. > > By the way, Massimo did not give

[web2py] Re: Does auth.requires() always requires login?

2011-10-18 Thread Ray (a.k.a. Iceberg)
Thanks Massimo and everyone took part in this thread. By the way, Massimo did not give the reason why changed auth.requires() behavior in 1.99.x, but here is my guess: otherwise it would become an easy mistake for web2py users (all of us), to just write auth.requires(condition) and forgetting it c

[web2py] Re: Does auth.requires() always requires login?

2011-10-17 Thread Massimo Di Pierro
ok. requires_login instead of login. Uploading to trunk. On Oct 17, 10:55 am, Jonathan Lundell wrote: > On Oct 17, 2011, at 6:21 AM, Massimo Di Pierro wrote: > > > @auth.requires(condition) > > > First checks that user is logged in then it check whether the > > condition is true or False. > > Thi

Re: [web2py] Re: Does auth.requires() always requires login?

2011-10-17 Thread Jonathan Lundell
On Oct 17, 2011, at 6:21 AM, Massimo Di Pierro wrote: > @auth.requires(condition) > > First checks that user is logged in then it check whether the > condition is true or False. > This behavior has changed but it was undocumented. > > I guess next question is how do you do what you need to do. I

[web2py] Re: Does auth.requires() always requires login?

2011-10-17 Thread Massimo Di Pierro
@auth.requires(condition) First checks that user is logged in then it check whether the condition is true or False. This behavior has changed but it was undocumented. I guess next question is how do you do what you need to do. I thought about it and I pushed this to trunk: @auth.requires(request

Re: [web2py] Re: Does auth.requires() always requires login?

2011-10-16 Thread Bruno Rocha
> > 2. if @auth already means authentication, why there is still an > auth.requires_login() which implemented as > auth.requires(auth.is_logged_in())? Shouldn't this implementation > imply that auth.requires() does not check is_logged_in()? All in all, > what is auth.requires()'s semantics? Wait

[web2py] Re: Does auth.requires() always requires login?

2011-10-16 Thread Ray (a.k.a. Iceberg)
Thanks for the workaround, I might take that. But I will still argue that: 1. Does authentication have to mean logged-in, or can it be something else, such as "accessing from localhost", "accessing via ajax", etc.? 2. if @auth already means authentication, why there is still an auth.requires_logi

[web2py] Re: Does auth.requires() always requires login?

2011-10-16 Thread Ray (a.k.a. Iceberg)
Thanks for prompt response Bruno. But unfortunately your suggestion doesn't help in my case, system admin still can not access from localhost without login. Regards, Ray On Oct 17, 12:41 pm, Bruno Rocha wrote: > Change teh behaviour with this: > > auth.settings.on_failed_authorization = lambda o