Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-12313

Support to stop rendering a Plugin in case the Plugin itself 'knows' that it shouldn't be drawn

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 14.0.0
    • None
    • None

    Description

      Currently, the PluginManager starts plugins from

       public PluginContext start(IPluginConfig config) {
              final PluginContext context = new PluginContext(this, config);
              IPlugin plugin = factory.createPlugin(context, config);
              if (plugin != null) {
                  context.connect(plugin);
                  return context;
              } else {
                  context.stop();
                  return null;
              }
          }
      
      

      which invokes org.hippoecm.frontend.plugin.impl.PluginFactory#createPlugin

      Now, if the plugin to be created, for example a 'FolderTreePlugin' (the drop down in the content editor for 'documents', 'gallery', 'assets', etc) finds out that the user is not allowed to read the right content (for example not allowed to read /content/gallery), then instead of logging a warning that /content/gallery does not exist and adding the 'Gallery' plugin to the drop down, it should just skip that plugin from the dropdown

      However currently, a plugin cannot during its creation throw some exception to gracefully short-circuit it being rendered without being logged as a warning or error

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              aschrijvers Ard Schrijvers
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: