Sorry for the necro but I just came across this myself and was surprised to see that the otherwise argument only works when the user cannot be authenticated. Any chance on changing this so that the 'otherwise' argument allows you to redirect if 'condition' fails as well?
On Wednesday, September 26, 2012 1:29:33 AM UTC, Anthony wrote: > > On Tuesday, September 25, 2012 7:52:48 PM UTC-4, shartha wrote: >> >> Thanks Anthony, your answer was pretty much what I needed. Ideally >> though, it would've been nice to be able to redirect to different pages >> based on different decorators. But I think that could be achieved within an >> if-block in the controller of the URL you set * >> auth.settings.on_failed_authorization* equal to. >> > > Yes, that's the way to go. All the decorators take an "otherwise" > argument, which can be a URL or a callable, but I think it only takes > effect if the user isn't logged in (i.e., not authenticated), not if a > logged in user isn't authorized. > > Anthony > -- --- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.