jong
April 22, 2021, 10:17am
1
For simplicity for end users, I want to hide plugins that the user has no permissions for.
The Security plugin does not show up in the nav bar for users without permission. Is it possible to hide other plugins from users without permissions?
For example, I’ve installed the Alerting plugin and it shows up here for a user with no permissions:
I want it to show:
Thanks!
jong
April 22, 2021, 10:34am
2
I found this old thread, but not really helpful.
How to hide Kibana menu for users? For example: I want hide Discover Alerting and Security.
How specifically does Kibana/OpenSearch decide whether or not to display the “Security” plugin in the nav bar? Is it possible to extend to functionality to other plugins? If anyone has any pointers I could look into maybe making changes and a pull request.
Moved to Security category.
jong
April 22, 2021, 2:17pm
4
Looks like this menu item is not displayed because of this line here:
public async setup(core: CoreSetup): Promise<OpendistroSecurityPluginSetup> {
const apiPermission = await hasApiPermission(core);
const config = this.initializerContext.config.get<ClientConfigType>();
const accountInfo = (await fetchAccountInfoSafe(core.http))?.data;
const isReadonly = accountInfo?.roles.some((role) =>
(config.readonly_mode?.roles || DEFAULT_READONLY_ROLES).includes(role)
);
if (apiPermission) {
core.application.register({
id: PLUGIN_NAME,
title: 'Security',
order: 8000,
mount: async (params: AppMountParameters) => {
const { renderApp } = await import('./apps/configuration/configuration-app');
const [coreStart, depsStart] = await core.getStartServices();
// merge OpenSearchDashboards yml configuration
includeClusterPermissions(config.clusterPermissions.include);
shansb
November 11, 2021, 1:18pm
5
Hi, is there an update on this issue?
pablo
November 11, 2021, 1:58pm
6
@shansb I don’t think there will be any for OpenDistro.
I suggest to open feature request for OpenSearch Dashboards.
https://github.com/opensearch-project/OpenSearch-Dashboards/issues
Currently the only mechanism to hide OpenSearch Dashboards menu elements based on user’s priviliges is opensearch_security.readonly_mode.roles
option.
However, this option won’t allow you to choose elements of the OpenSearch Dashboards menu and will disable everything except Dashboards.
shansb
November 11, 2021, 2:12pm
7