Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Prevent admin user from disabling servlet-filter module. Edited

We're developing a plugin which core functionality relies on a servlet filter, this however can be disabled from upm page expanding modules of our plugin. Is there a way to hide the disable button for this specific servlet filter?

1 answer

1 accepted

0 votes
Answer accepted

An admin can always disable any module that is not flagged as a "system essential" module.  You'd need to change the core code of Jira to tell it that the servlet filter is such a module, there's no way to protect it from the outside.

Best you can do is detect it as your app loads and throw an error that just stops it loading/enabling and tells the admin why it's refusing to load.

Thanks for the response @Nic Brough _Adaptavist_, let's say plugin is installed for the first time with this module enabled, so everything is good; but then, admin user decides to disable it. Is there a way to be notified of this event? If so, could I programmatically disable the whole plugin?

 

Thanks in advance.

That would be a lot nicer than a simple crash from your app.  There may be a way to write a listener that catches "plugin/module disabled" and causes yours to be disabled if they hit that one, but I'm really not sure.

Thanks Nic! this is how I finally solve it:

public class PluginModuleEventAware implements DisposableBean, InitializingBean {

private final EventPublisher eventPublisher;
private final PluginController pluginController;

public PluginModuleEventAware(EventPublisher eventPublisher, PluginController pluginController) {
this.pluginController = pluginController;
this.eventPublisher = eventPublisher;
}

@Override
public void afterPropertiesSet() throws Exception {
eventPublisher.register(this);
}

@Override
public void destroy() throws Exception {
eventPublisher.unregister(this);
}

@EventListener
public void onModuleDisabledEvent(PluginModuleDisabledEvent moduleDisabledEvent) {
if (moduleDisabledEvent.getModule().getKey().equals("my-core-filter")) {
pluginController.enablePluginModule(moduleDisabledEvent.getModule().getCompleteKey());
}
}

}

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Software

How to create Jira issus from Excel file?

When to use CSV importer When managing your processes in Jira, there are many occasions where you need to create a lot of tasks. Creating them one by one will cost you a lot of time and effort and i...

4,642 views 22 33
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you