fix(cms): fix queries and field mapping for CMS
This fixes a couple of things:
- Queries by Flax coming from outside kotahi didn't have a userId set in the context, and were causing crashes in some of the permissions rules. I've made those more robust.
- Form fields are expected to have a
permitPublishing
value set to "true", "false" or "always" (these are strings). But for historical reasons these weren't always set. This meant that some field data was not being passed through to flax. I've created a migration and also modified the built-in forms that we seed from. - A couple of the built-in forms were still using an outdated name for the authors field; I've changed it to
submission.$authors
. No releases have gone out since I merged the standard fields work, so no migration is needed.
This work ties in with flax!24 (merged)