That looks pretty good. If you want to avoid running all your models, you
can put that logic early in your models (obviously somewhere after auth is
defined):
if request.controller == 'secret_stuff' and not auth.has_membership('admin'
):
Anthony
On Wednesday, July 25, 2012 9:14:31 PM UTC-4, Richard Penman wrote:
>
> I mean is there a better way than something like:
>
> if not auth.has_membership('admin'):
> session.flash = 'You are not part of the admin group'
> redirect(URL(r=request, c='default', f='index'))
>
--