Can you try:

@auth.requires(auth.has_membership(...) or not request.env)

On Nov 9, 6:53 am, mika <[email protected]> wrote:
> I have no idea for such condition.
> Maybe it is possible to add support for built-in user 'cron',
> so calling functions from cron would be called as user 'cron'?
>
> On Nov 6, 6:29 pm, mdipierro <[email protected]> wrote:
>
> > You cannot do
>
> > @auth.requires_membership(....)
>
> > and call it from cron because there is no user to check permissions
> > against. You can do
>
> > @auth.requires(auth.has_membership(...) or condition)
>
> > where condition is something that determines whether it is being
> > called by CRON. I cannot think of anything that defines condition.
> > Perhaps something missing in request.env? This needs to be tested. If
> > you do any test, please let us know.
>
> > On Nov 6, 4:58 am,mika<[email protected]> wrote:
>
> > > hi!
>
> > > I noticed that if I decorate a function with a
> > > @auth.requires_membership,
> > > the function call from cron not work and give the:
> > > WARNING:root:WEB2PY CRON Call returned code 1: No error message
> > > available
>
> > > what I need to enable calling such functions from cron?
>
> > > my cron looks like:
> > > */5 * * * *             root *control/dec_function
>
> > > best regards,
> > >mika
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to