-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Closed
Labels
Feature:New PlatformTeam:CorePlatform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t//Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t//blockerdiscuss
Description
There are 3 different cases when an application should be disabled or hidden from the UI:
- The user does not have the privileges via Feature Controls (aka uiCapabilities)
- The Elasticsearch cluster does not have the appropriate license
- The Kibana configuration has disabled the UI for a given application, but not the entire plugin (eg.
timelion.ui.enabled).
In the Legacy Platform we have a few different mechanisms for controlling which apps are shown & allowed.
- Some apps are disabled using a uiExport hack that calls
chrome.navLinks.update()to disable a navlink based on some of the conditions listed above. Each app has to do this separately and the implementations are not consistent. - Feature controls filter out applications by toggling the appropriate
navLinkitem inuiCapabilities.
The ApplicationService should expose a function that allows other systems to register an Observable of filtering functions that can be used to disable and hide applications. This would allow the Licensing and Feature Control plugins to extend the ApplicationService with this knowledge in a single place, rather than each plugin defining this logic.
Example API
type AppFilter = (app: App) => {
visible: boolean;
enabled: boolean;
}
interface ApplicationSetup {
registerAppFilter(filter$: Observable<AppFilter>): void;
}// Example usage inside the licensing plugin
core.application.registerAppFilter(
license$.pipe(
map(license => (app: App) => ({
visible: license.get(`features.${app.id}.showAppLink`),
enabled: license.get(`features.${app.id}.enableAppLink`),
})
)
)Metadata
Metadata
Assignees
Labels
Feature:New PlatformTeam:CorePlatform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t//Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t//blockerdiscuss