- Create a new model with a relationship to CMSPlugin class.
- Add a disabled = BooleanField(default=False) field to this class.
- Create a plugin on this app whose only purpose is to extend the global plugin menu actions, this plugin is not renderable or even shown to the user, it's only used internally. I'm not too fond of this approach (abusing plugin to extend menu only) but I think it's the easiest solution for now, anything else would require a big change on the core to allow non plugins to extend the plugin actions menu. The alias plugin is a good example of how to achieve this.
- An advantage of using an internal plugin is that you can use the get_plugin_urls() method to register the ajax endpoint that will be called when a user activates/deactivates a plugin.
- Naming-wise, we suggest "disable" and "enable" as the action names, "hide" and "show" are used by the structure board already and this can confuse some users.
As suggested on that Github thread, I'm opening a thread here so that we can continue collaboration around that feature and discuss how to move forward. I'm doing work for a client who is strongly interested in having this feature, so I am quite motivated to help bring it together. :)
The unresolved questions related to this addition are (per the GH thread):
- Somehow get the cms to know about the disabled field and not render the plugin.
- Performance impact per plugin