aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-ui/src/app/ng2')
-rw-r--r--catalog-ui/src/app/ng2/components/layout/top-nav/top-nav.component.ts13
-rw-r--r--catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.component.ts5
2 files changed, 8 insertions, 10 deletions
diff --git a/catalog-ui/src/app/ng2/components/layout/top-nav/top-nav.component.ts b/catalog-ui/src/app/ng2/components/layout/top-nav/top-nav.component.ts
index 5e43fec680..b8b0e80861 100644
--- a/catalog-ui/src/app/ng2/components/layout/top-nav/top-nav.component.ts
+++ b/catalog-ui/src/app/ng2/components/layout/top-nav/top-nav.component.ts
@@ -120,14 +120,15 @@ export class TopNavComponent {
tmpArray.push(new MenuItem(hostedApp.navTitle, null, hostedApp.defaultState, "goToState", null, null));
}
});
-
- _.each(PluginsConfiguration.plugins, (plugin: Plugin) => {
- if (plugin.pluginDisplayOptions["top"]) {
- tmpArray.push(new MenuItem(plugin.pluginDisplayOptions["top"].displayName, null, "plugins", "goToState", {path: plugin.pluginStateUrl}, null));
- }
- })
}
+ // Adding plugins to top-nav only if they can be displayed for the current connected user role
+ _.each(PluginsConfiguration.plugins, (plugin: Plugin) => {
+ if (plugin.pluginDisplayOptions["tab"] && (this.user && plugin.pluginDisplayOptions["tab"].displayRoles.includes(this.user.role))) {
+ tmpArray.push(new MenuItem(plugin.pluginDisplayOptions["tab"].displayName, null, "plugins", "goToState", {path: plugin.pluginStateUrl}, null));
+ }
+ });
+
this.topLvlMenu = new MenuItemGroup(0, tmpArray, true);
this.topLvlMenu.selectedIndex = isNaN(this.topLvlSelectedIndex) ? this._getTopLvlSelectedIndexByState() : this.topLvlSelectedIndex;
diff --git a/catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.component.ts b/catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.component.ts
index 169cad0411..801dfa98fe 100644
--- a/catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.component.ts
+++ b/catalog-ui/src/app/ng2/components/ui/plugin/plugin-frame.component.ts
@@ -21,10 +21,7 @@ export class PluginFrameComponent implements OnInit {
ngOnInit(): void {
- this.pluginUrl = this.plugin.pluginProtocol + "://" +
- this.plugin.pluginHost + ":" +
- this.plugin.pluginPort +
- this.plugin.pluginPath;
+ this.pluginUrl = this.plugin.pluginSourceUrl;
if (this.queryParams && !_.isEmpty(this.queryParams)) {
_.forOwn(this.queryParams, (value, key) => {