diff options
Diffstat (limited to 'base/tps/shared/webapps/tps/ui/index.html')
-rw-r--r-- | base/tps/shared/webapps/tps/ui/index.html | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/base/tps/shared/webapps/tps/ui/index.html b/base/tps/shared/webapps/tps/ui/index.html index 74adeadd1..3bda3cb40 100644 --- a/base/tps/shared/webapps/tps/ui/index.html +++ b/base/tps/shared/webapps/tps/ui/index.html @@ -47,10 +47,26 @@ $(function() { var account = new Account(); account.login({ success: function(data, textStatus, jqXHR) { + tps.user = data; + var roles = tps.user.Roles.Role; + var user = $("#user"); user.text(data.FullName); + + var accounts_menu = $("#navigation [name=accounts]"); + var system_menu = $("#navigation [name=system]"); + + if (_.contains(roles, "Administrators")) { + accounts_menu.show(); + $("li", system_menu).show(); + + } else if (_.contains(roles, "TPS Agents")) { + accounts_menu.hide(); + $("li", system_menu).hide(); + $("[name=profiles]", system_menu).show(); + } }, - error: function() { + error: function(jqXHR, textStatus, errorThrown) { window.location.href = "/tps"; } }); @@ -60,7 +76,7 @@ $(function() { var router = new Backbone.Router(); router.route("", "home", function() { - new Page({ + new HomePage({ el: content, url: "home.html" }).open(); @@ -330,6 +346,7 @@ $(function() { // destroy server session account.logout({ success: function() { + tps.user = null; // clear browser cache PKI.logout({ success: function() { @@ -382,7 +399,7 @@ $(function() { <li><a href="#tokens">Tokens</a></li> <li><a href="#certs">Certificates</a></li> <li><a href="#activities">Activities</a></li> - <li class="dropdown context"> + <li name="accounts" class="dropdown context" style="display: none;"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> Accounts <b class="caret"></b> @@ -392,19 +409,19 @@ $(function() { <li><a href="#groups">Groups</a></li> </ul> </li> - <li class="dropdown context"> + <li name="system" class="dropdown context"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> System <b class="caret"></b> </a> <ul class="dropdown-menu"> - <li><a href="#config">General Configuration</a></li> - <li><a href="#authenticators">Authentication Sources</a></li> - <li><a href="#connectors">Subsystem Connections</a></li> - <li><a href="#profiles">Profiles</a></li> - <li><a href="#profile-mappings">Profile Mappings</a></li> - <li><a href="#audit">Audit Logging</a></li> - <li><a href="#selftests">Self Tests</a></li> + <li name="config" style="display: none;"><a href="#config">General Configuration</a></li> + <li name="authenticators" style="display: none;"><a href="#authenticators">Authentication Sources</a></li> + <li name="connectors" style="display: none;"><a href="#connectors">Subsystem Connections</a></li> + <li name="profiles" style="display: none;"><a href="#profiles">Profiles</a></li> + <li name="profile-mappings" style="display: none;"><a href="#profile-mappings">Profile Mappings</a></li> + <li name="audit" style="display: none;"><a href="#audit">Audit Logging</a></li> + <li name="selftests" style="display: none;"><a href="#selftests">Self Tests</a></li> </ul> </li> </ul> |