Using the catalog in plone command line scripting


When running a command line script with 'bin/instance run <script>' the catalog always returns 0 results. Why?

Its all on http://collective-docs.readthedocs.org/en/latest/misc/commandline.html

One needs to spoof the request in order to get results from the catalog. Thinking about it. Might have to do with permissions - on the site that I use no content is visible at all to unauthorized users.