4teamwork / ftw.solr

Solr integration for Plone
5 stars 5 forks source link

Make sure maintenance scripts are run as system user. #168

Closed njohner closed 4 years ago

njohner commented 4 years ago

In the maintenance scripts we rely on the owner of the plone site to be a system. It seems that we have many deployments for which the plone site owner is admin, a user that does not exist, and the maintenance scripts therefore get executed as anonymous with obvious consequences, i.e. they fail as not all objects can be accessed.

The proposed fix comes from how this is done for bin/instance run scripts (https://github.com/plone/plone.recipe.zope2instance/blob/master/src/plone/recipe/zope2instance/ctl.py#L691-L694).

As to why certain of our sites are owned by the admin user, here is what I found out:

For https://4teamwork.atlassian.net/browse/GEVER-192