mirror of
https://github.com/sismics/docs.git
synced 2024-11-22 05:57:57 +01:00
Hide admin only menu in settings tab
This commit is contained in:
parent
10a7be01f5
commit
c37fb1d4ae
@ -4,4 +4,8 @@
|
|||||||
* Settings controller.
|
* Settings controller.
|
||||||
*/
|
*/
|
||||||
App.controller('Settings', function($scope, Restangular) {
|
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;
|
||||||
|
});
|
||||||
});
|
});
|
@ -6,9 +6,9 @@
|
|||||||
<li ng-class="{active: $uiRoute}" ui-route="/settings/account"><a href="#/settings/account">User account</a></li>
|
<li ng-class="{active: $uiRoute}" ui-route="/settings/account"><a href="#/settings/account">User account</a></li>
|
||||||
<li ng-class="{active: $uiRoute}" ui-route="/settings/session"><a href="#/settings/session">Opened sessions</a></li>
|
<li ng-class="{active: $uiRoute}" ui-route="/settings/session"><a href="#/settings/session">Opened sessions</a></li>
|
||||||
|
|
||||||
<li class="nav-header">General settings</li>
|
<li class="nav-header" ng-show="isAdmin">General settings</li>
|
||||||
<li ng-class="{active: $uiRoute}" ui-route="/settings/user.*" ng-show="userInfo.base_functions.indexOf('ADMIN') != -1"><a href="#/settings/user">Users</a></li>
|
<li ng-show="isAdmin" ng-class="{active: $uiRoute}" ui-route="/settings/user.*"><a href="#/settings/user">Users</a></li>
|
||||||
<li ng-class="{active: $uiRoute}" ui-route="/settings/log"><a href="#/settings/log">Server logs</a></li>
|
<li ng-show="isAdmin" ng-class="{active: $uiRoute}" ui-route="/settings/log"><a href="#/settings/log">Server logs</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user