pgreco / rpms / ipa

Forked from forks/areguera/rpms/ipa 4 years ago
Clone

Blame SOURCES/0024-WebUI-Fix-showing-vault-in-selfservice-view.patch

483b06
From 5ccffb9ca109d820c5535140713a5b6672aa4f71 Mon Sep 17 00:00:00 2001
483b06
From: Pavel Vomacka <pvomacka@redhat.com>
483b06
Date: Fri, 24 Mar 2017 10:19:21 +0100
483b06
Subject: [PATCH] WebUI: Fix showing vault in selfservice view
483b06
483b06
Vaults menu item was shown even when the KRA service was not installed.
483b06
That was caused by different path to the menu item in admin's view
483b06
and in selfservice view.
483b06
483b06
The path is now set correctly for both situations. 'network_service/vault'
483b06
for admin's view and 'vault' for selfservice view.
483b06
483b06
https://pagure.io/freeipa/issue/6812
483b06
483b06
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
483b06
---
483b06
 install/ui/src/freeipa/navigation/menu_spec.js | 1 +
483b06
 install/ui/src/freeipa/vault.js                | 8 +++++---
483b06
 2 files changed, 6 insertions(+), 3 deletions(-)
483b06
483b06
diff --git a/install/ui/src/freeipa/navigation/menu_spec.js b/install/ui/src/freeipa/navigation/menu_spec.js
483b06
index 9329694c14a47cbe1ec244554327b40743044d7b..0c30459691d8f652dc35ccf74ed27fae7654020d 100644
483b06
--- a/install/ui/src/freeipa/navigation/menu_spec.js
483b06
+++ b/install/ui/src/freeipa/navigation/menu_spec.js
483b06
@@ -326,6 +326,7 @@ nav.self_service = {
483b06
         { entity: 'user' },
483b06
         { entity: 'otptoken' },
483b06
         {
483b06
+            name: 'vault',
483b06
             entity: 'vault',
483b06
             facet: 'search',
483b06
             children: [
483b06
diff --git a/install/ui/src/freeipa/vault.js b/install/ui/src/freeipa/vault.js
483b06
index b5cdc810adea9b521df77eb328b55475a707580a..36a4838ee108020cf6ad7a20c59e4ab5403f3528 100644
483b06
--- a/install/ui/src/freeipa/vault.js
483b06
+++ b/install/ui/src/freeipa/vault.js
483b06
@@ -809,9 +809,11 @@ vault.config_sidebar_policy = function(spec) {
483b06
 
483b06
 
483b06
 vault.remove_vault_menu_item = function() {
483b06
-    if (!IPA.vault_enabled) {
483b06
-        menu.remove_item('network_services/vault');
483b06
-    }
483b06
+    if (IPA.vault_enabled) return;
483b06
+
483b06
+    var menu_location = IPA.is_selfservice ? 'vault' : 'network_services/vault';
483b06
+
483b06
+    menu.remove_item(menu_location);
483b06
 };
483b06
 
483b06
 vault.my_vault_spec = make_my_vault_spec();
483b06
-- 
483b06
2.12.1
483b06