summaryrefslogtreecommitdiffstats
path: root/base/tps/shared/webapps/tps/ui
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2015-12-22 22:01:10 +0100
committerEndi S. Dewata <edewata@redhat.com>2016-01-18 16:45:07 +0100
commit77d6c95527f2f7299e3baece465ef9d778815745 (patch)
tree60a0cfe4f7f45e87559dd05ed62070fd5e487b4f /base/tps/shared/webapps/tps/ui
parent9a6a3d1cbf6e347b2cf0737afca4f793a6a0d0ba (diff)
downloadpki-77d6c95527f2f7299e3baece465ef9d778815745.tar.gz
pki-77d6c95527f2f7299e3baece465ef9d778815745.tar.xz
pki-77d6c95527f2f7299e3baece465ef9d778815745.zip
Fixed TPS UI to display accessible services only.
The TPS UI has been modified to display the accessible services based on the user's roles. A TPS admin has access to all services. A TPS agent has access to tokens, certificates, activities, and profiles. A TPS operator has access to tokens, certificates, and activities only. https://fedorahosted.org/pki/ticket/1476
Diffstat (limited to 'base/tps/shared/webapps/tps/ui')
-rw-r--r--base/tps/shared/webapps/tps/ui/home.html4
-rw-r--r--base/tps/shared/webapps/tps/ui/index.html23
2 files changed, 20 insertions, 7 deletions
diff --git a/base/tps/shared/webapps/tps/ui/home.html b/base/tps/shared/webapps/tps/ui/home.html
index eb6874e50..6ad285076 100644
--- a/base/tps/shared/webapps/tps/ui/home.html
+++ b/base/tps/shared/webapps/tps/ui/home.html
@@ -36,7 +36,7 @@
</div>
</div>
-<div name="home-accounts" class="panel panel-default">
+<div name="home-accounts" class="panel panel-default" style="display: none;">
<div class="panel-heading">
<h3 class="panel-title">Account Management</h3>
</div>
@@ -48,7 +48,7 @@
</div>
</div>
-<div name="home-system" class="panel panel-default">
+<div name="home-system" class="panel panel-default" style="display: none;">
<div class="panel-heading">
<h3 class="panel-title">System Management</h3>
</div>
diff --git a/base/tps/shared/webapps/tps/ui/index.html b/base/tps/shared/webapps/tps/ui/index.html
index 4bf0ea94b..5e07f1ed3 100644
--- a/base/tps/shared/webapps/tps/ui/index.html
+++ b/base/tps/shared/webapps/tps/ui/index.html
@@ -58,13 +58,24 @@ $(function() {
if (_.contains(roles, "Administrators")) {
accounts_menu.show();
+ } else {
+ accounts_menu.hide();
+ }
+
+ if (_.contains(roles, "Administrators")) {
+ system_menu.show();
$("li", system_menu).show();
} else if (_.contains(roles, "TPS Agents")) {
- accounts_menu.hide();
+ system_menu.show();
$("li", system_menu).hide();
$("[name=profiles]", system_menu).show();
+
+ } else {
+ system_menu.hide();
}
+
+ homePage.update();
},
error: function(jqXHR, textStatus, errorThrown) {
window.location.href = "/tps";
@@ -75,11 +86,13 @@ $(function() {
var router = new Backbone.Router();
+ var homePage = new HomePage({
+ el: content,
+ url: "home.html"
+ });
+
router.route("", "home", function() {
- new HomePage({
- el: content,
- url: "home.html"
- }).open();
+ homePage.open();
});
router.route("activities", "activities", function() {