This will be a lot easier in an upcoming (soon) release with improved access control.
For now, if you have the possibility to change the code, I think the best way to show more menu items for those users would be to add the items here:
If you know the id of those items, you should be able to add them to that list, like this
let visibleNavLinkIds = [
‘kibana:dashboard’,
‘yourMenuItem’,
‘yourSecondMenuItem’
];
Hide navigation links that aren’t needed in the dashboard only mode.
@param {Boolean} multitenancyVisible - If true, we won’t hide the
*/
function hideNavItemsForDashboardOnly(multitenancyVisible) {
let visibleNavLinkIds = [
‘kibana:dashboard’,‘kibana:school’
];
if (multitenancyVisible) {
visibleNavLinkIds.push(‘searchguard-multitenancy’);
}
chrome.getNavLinks().forEach((navLink) => {
if (visibleNavLinkIds.indexOf(navLink.id) === -1) {
// A bit redundant if all items are hidden from the start
navLink.hidden = true;
} else if (originalNavItemsVisibility !== null) {
navLink.hidden = originalNavItemsVisibility[navLink.id];
}
});
}
and in index.js
, {
id: ‘kibana:school’,
title: ‘School Report’,
order: -1004,
url: ${kbnBaseUrl}#/dashboard/169346d0-14a9-11e9-a4bc-a7d61b69fdb6?_g=(),
// The subUrlBase is the common substring of all urls for this app. If not given, it defaults to the url
// above. This app has to use a different subUrlBase, in addition to the url above, because “#/dashboard”
// routes to a page that creates a new dashboard. When we introduced a landing page, we needed to change
// the url above in order to preserve the original url for BWC. The subUrlBase helps the Chrome api nav
// to determine what url to use for the app link.
subUrlBase: ${kbnBaseUrl}#/dashboard,
description: ‘compose visualizations for much win’,
icon: ‘plugins/kibana/assets/dashboard.svg’,
euiIconType: ‘dashboardApp’
}
Hmm I just tested this, and it seems wo work. My guess would be, that you should write school instead of kibana:school.
To find the id of the apps, you cann add this line to output all the apps/navLinks - the id property for your app is the one you should use.
console.log(chrome.getNavLinks());