No because the function has no way to know it is being access by CRON. Moreover if the function requires login it probably assumes the existence of a user. In case of cron who is the user? What if no user yet registered with the app?
On Jul 28, 10:24 am, Iceberg <iceb...@21cn.com> wrote: > I am digging out an old thread, quoted at the of this post, (up side > down). > > I can confirmed Mika's problem does exist. In fact, not to mention > cron feature, even a normal request from browser will be intercepted > by any presence of @auth.requires(...) > > For example: > @auth.requires(True) # or auth.requires(whatever) > def foo(): > return 'bar' > is always protected by authentication. Is this a desired effect in > original design, Massimo? > > So currently there is no way for a cron job to access any action > protected by authentication (a.k.a. the secured function). > > Regards, > Iceberg > > On Jun22, 12:30am, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > try > > > @auth.requires(request.client==None or > > auth.has_membership('managers')) > > > On Jun 21, 2:53 am, mika <miss.from.h...@gmail.com> wrote: > > > > hi > > > I can't find solution to call the function protected by auth from > > >cron. > > > > I have defined auth group managers, and decorated function with > > > > @auth.requires(not request.wsgi or auth.has_membership('managers')) > > > > unfortunatelly, that is not working fromcron. > > > > i havetried also > > > > @auth.requires(not request.env or auth.has_membership('supervisors')) > > > > the same... > > > > how to achieve it?