Issue with application context and background jobs

10 views
Skip to first unread message

Ejay Aito

unread,
May 28, 2023, 9:47:56 AM5/28/23
to CKAN Development Discussions
Hello,
I am trying to run this call `toolkit.get_action('package_show')`  in a background job but I keep getting a `Not Authorized` error. 
Which means that it needs a user/userobj.

My question is how do I pass along an authorization object in a background job? Or how do I call it anonymously (ignore_auth=True)? Is this even possible?

Thanks for your help.

Andrés Vázquez

unread,
May 30, 2023, 9:29:52 AM5/30/23
to Ejay Aito, CKAN Development Discussions
Yes Ejay, you can use ignore_auth

Here an example of an internal job with package show in an extension:


Cheers,

Andrés



--
ckan-dev mailing list
ckan...@ckan.org
https://groups.google.com/a/ckan.org/forum/#!forum/ckan-dev
Unsubscribe: send an email to ckan-dev+u...@ckan.org
---
To unsubscribe from this group and stop receiving emails from it, send an email to ckan-dev+u...@ckan.org.
Reply all
Reply to author
Forward
0 new messages