You could do something like this in a model file or at the top of a
controller (outside any functions):
(auth.user or request.args(0) == 'login') or redirect(URL('default', 'user',args
='login'))
Anthony
On Wednesday, February 27, 2013 12:05:33 PM UTC-5, Philip Kilner wrote:
>
> Hi All,
>
> This is one of those "I really ought to know this one" things...
>
> I'm used to selectively requiring login, per function.
>
> However, this is too easy to overlook!
>
> Is there a quick way to require login for either every function in a
> given controller, or for the entire app?
>
> (Have scoured the book, but don't think I'm using the right search terms!)
>
>
>
> --
>
> Regards,
>
> PhilK
>
>
> 'a bell is a cup...until it is struck'
>
>
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.