Hide UI Element Built-In Script
This built-in script allows you to hide any system web item or panel, or those that are provided by plugins.
The Atlassian applications are supremely flexible, but this comes at the cost of some complexity.
This built-in script will only hide the web item; if your users can determine the invoked URL, they can still do the action. This is to reduce clutter and allow users to focus on the most important elements in the user interface.
To be more specific, it allows you to add additional conditions to these UI elements, so you can control more precisely when they are displayed.
- Don't confuse your users. If you remove a menu item, make sure you document it and explain to your users why it's not available.
- Don't confuse Atlassian Support. Don't forget you have done this and raise a support request with Atlassian. You can see all the hidden items at Admin > Script Fragments. Alternatively, disabling ScriptRunner will restore anything that it is hiding. Before raising a ticket about a missing item, please check the hidden items to ensure this script is not the reason.
Examples
Hide Export to PDF Item
You can disable the Export to PDF and Export to Word options for pages in one project.
Hide Social Features
Similar to the previous example, you can disable the social features for pages in one project.
import com.atlassian.plugin.PluginController
import com.atlassian.sal.api.component.ComponentLocator
def pluginController = ComponentLocator.getComponent(PluginController)
pluginController.disablePluginModule("com.atlassian.confluence.plugins.confluence-like:content-like-resources")
pluginController.disablePluginModule("com.atlassian.confluence.plugins.confluence-like:mobile-content-like-resource")./confluence/users/userpopup.vm.