This application is used to show two different methods for more complex draft workflows, the logic is very basic but could be modified for more advanced options.
There are two sets of models:
- A basic
articlemodel that has an enum to set it's "status", these status values cannot be modified in production but provide a very simple model structure - A more complex
alternative-articlemodel as well as astatusmodel that have a oneWay relationship. This allows for the status model to be used in other models but provide more flexibility on adjusting the status values in production.
Included are two sample policies that effectively do the same thing but are slightly modified to allow for the relation in the complex example.
- basic policy => This policy simple checks there is no
statusfilter supplied and applies a default forproductionelse if a filter is applied then that filter is used. - advanced policy => This policy is a bit more advanced as it's filtering on a nested relation value (in this case the UID) but does the same thing as the basic policy.
For REST these are applied in the routes.json for each model:
- The basic article model => applied from a global level
- The advanced alt article model => also applied from a global level
For GraphQL, the schemas must be modified to include the policy: