I am querying for list items in a timer job. The list has moderation enabled. It has various list items that have different approval status (e.g. scheduled, approved etc.).
However the query always returns all items in "draft" mode and there is no way of querying for items with different approval status. The same happens when I log in to the site as System Account and view the library, it will show all items in draft status.
Why is the moderation status not visible for the system account? Other moderation info such as comments are showing.
Impersonating the Site Owner account works fine and the query returns all moderationinformation. E.g.
SPUserToken token = site.Owner.UserToken; var impersonatedSite = new SPSite(site.ID, token);