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 <[email protected]> wrote:
> try
>
> @auth.requires(request.client==None or
> auth.has_membership('managers'))
>
> On Jun 21, 2:53 am, mika <[email protected]> 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?