vip-governance-plugin
vip-governance-plugin copied to clipboard
Allow restricting the rules based on the page
As part of the fix for #79, the governance plugin will only load when a page or post is being edited/created. This should be turned instead into a configuration within the rules file that can allow the rules to be selectively loaded based on the page, such as the widgets screen, etc.
Ideally, an allowedIn parameter that accepts an array of possible pages would work best. This would look as follows:
allowedIn: [ 'widgets', 'site-editor' ]
The assumption is the post editor would work by default. This would be additions on top of that.
We've seen a request for different rules based on the page/context. So that there would be specific governance for widgets.
This is especially necessary for the Site Editor.
Instead of a config in the rules file, could we have a naming convention for rules files per context? If we did this and kept with our least access principle, no file would mean no access. We may want to examine that and include permissive default files per context.