Yes, use the lambda form -- that way it will only do the has_membership 
queries when the index function is called rather than on every request to 
the controller.

Anthony

On Tuesday, May 1, 2012 12:50:47 AM UTC-4, Annet wrote:
>
> Hi Bruce,
>
> I had the same problem, this is the best solution, according to Anthony (
> https://groups.google.com/forum/#!msg/web2py/A0z8DSZdYTo/H_1N6_4MZfEJ):
>
> @auth.requires(lambda: auth.has_membership('Analytics') or 
> auth.has_membership('Analytics Manager))
>
> I made the groups constants, in my case:
>
> NODE='Node Manager'
> HUB='Hub Manager'
>
>
> Best regards,
>
> Annet
>

Reply via email to