[web2py] Re: can we paint a def function with multiple memberships

2013-08-20 Thread lucas
thanx fabiano and anthony, awesome. lucas On Monday, August 19, 2013 9:23:21 PM UTC-4, lucas wrote: i am aware of: @auth.requires_membership('Administrator') def users(): etc however, can we allow for multiple or's, like @auth.requires_membership('Administrator') or

[web2py] Re: can we paint a def function with multiple memberships

2013-08-19 Thread Fabiano
Almost ;) @auth.requires(auth.has_membership('Administrator') or auth.has_membership( 'Manager')) http://www.web2py.com/books/default/chapter/29/09/access-control#Combining-requirements Fabiano. On Monday, August 19, 2013 10:23:21 PM UTC-3, lucas wrote: i am aware of:

[web2py] Re: can we paint a def function with multiple memberships

2013-08-19 Thread Anthony
On Monday, August 19, 2013 10:11:17 PM UTC-7, Fabiano wrote: Almost ;) @auth.requires(auth.has_membership('Administrator') or auth.has_membership ('Manager')) Better to put the condition in a lambda so it only gets evaluated when the decorated function is called rather than every time the