From c37fb1d4aecee352b09b1c7215554d102203adac Mon Sep 17 00:00:00 2001 From: jendib Date: Mon, 12 Aug 2013 21:20:34 +0200 Subject: [PATCH] Hide admin only menu in settings tab --- docs-web/src/main/webapp/js/controller/Settings.js | 4 ++++ docs-web/src/main/webapp/partial/settings.html | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs-web/src/main/webapp/js/controller/Settings.js b/docs-web/src/main/webapp/js/controller/Settings.js index e5cf7026..dfd6fbb1 100644 --- a/docs-web/src/main/webapp/js/controller/Settings.js +++ b/docs-web/src/main/webapp/js/controller/Settings.js @@ -4,4 +4,8 @@ * Settings controller. */ App.controller('Settings', function($scope, Restangular) { + // Flag if the user is admin + $scope.userInfo.then(function (data) { + $scope.isAdmin = data.base_functions.indexOf('ADMIN') != -1; + }); }); \ No newline at end of file diff --git a/docs-web/src/main/webapp/partial/settings.html b/docs-web/src/main/webapp/partial/settings.html index a55214d7..2563eff3 100644 --- a/docs-web/src/main/webapp/partial/settings.html +++ b/docs-web/src/main/webapp/partial/settings.html @@ -6,9 +6,9 @@
  • User account
  • Opened sessions
  • - -
  • Users
  • -
  • Server logs
  • + +
  • Users
  • +
  • Server logs