[web2py] Re: How do I combine @auth.requires_signature with @auth.requires_membership

2013-04-12 Thread Anthony
@auth.requires_membership() was changed so it only does its query when the decorated function is actually called. However, you are using the more generic @auth.requires(), which can take any condition. There's no way to automatically make the evaluation of that condition lazy, so you are respon

[web2py] Re: How do I combine @auth.requires_signature with @auth.requires_membership

2013-04-12 Thread SimonD
Anthony, Thanks so much for sharing the expertise, and so quickly. I had completely misunderstood about the decorators. Actually stacking them is the simplest and easiest answer, given that it is a valid thing to do. I hear what you say about the unnecessary database hits and the lambda. I had

[web2py] Re: How do I combine @auth.requires_signature with @auth.requires_membership

2013-04-12 Thread Anthony
> > @auth.requires(auth.has_membership('Approver') or > auth.has_membership('Admin')) #allowing Admin or Approvers to access The above will execute the has_membership queries every time the controller is called, even when not accessing the decorated function. To avoid the unnecessary databa