> @auth.requires(auth.has_membership('group1') or 
> auth.has_membership('group2'))
>
> Is this the best practice?
>

Better:

@auth.requires(lambda: auth.has_membership('group1') or auth.has_membership(
'group2'))

That way the has membership queries only get run when the decorated 
function is called, not every time the controller is accessed.

However, I think we should support passing a list to 
auth.requires_membership.

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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to