GUAC-1133: Fix disabling of management menu options for users/connections/sessions.

This commit is contained in:
Michael Jumper
2015-03-19 15:01:53 -07:00
parent e8d9a671a4
commit 70e7d1b329
2 changed files with 25 additions and 16 deletions

View File

@@ -97,29 +97,30 @@ angular.module('userMenu').directive('guacUserMenu', [function guacUserMenu() {
* @type Boolean
*/
$scope.manageUsersDisabled =
($location.path() === '/manage/modules/user');
($location.path() === '/manage/modules/users/');
/**
* Whether the option to go to the connection management interface is
* disabled. Note that shis is different from canManageConnections,
* which deals with whether permission to manage is granted. A user
* may have permission, yet see this option as currently disabled.
* Whether the option to go to the connection management interface
* is disabled. Note that shis is different from
* canManageConnections, which deals with whether permission to
* manage is granted. A user may have permission, yet see this
* option as currently disabled.
*
* @type Boolean
*/
$scope.manageConnectionsDisabled =
($location.path() === '/manage/modules/connections');
($location.path() === '/manage/modules/connections/');
/**
* Whether the option to go to the session management interface is
* disabled. Note that shis is different from canManageConnections,
* disabled. Note that shis is different from canManageSessions,
* which deals with whether permission to manage is granted. A user
* may have permission, yet see this option as currently disabled.
*
* @type Boolean
*/
$scope.manageSessionsDisabled =
($location.path() === '/manage/modules/sessions');
($location.path() === '/manage/modules/sessions/');
/**
* Whether the current user has sufficient permissions to use the
@@ -350,21 +351,21 @@ angular.module('userMenu').directive('guacUserMenu', [function guacUserMenu() {
* Navigates to the user management interface.
*/
$scope.manageUsers = function manageUsers() {
$location.path('/manage/modules/users');
$location.path('/manage/modules/users/');
};
/**
* Navigates to the connection management interface.
*/
$scope.manageConnections = function manageConnections() {
$location.path('/manage/modules/connections');
$location.path('/manage/modules/connections/');
};
/**
* Navigates to the user session management interface.
*/
$scope.manageSessions = function manageSessions() {
$location.path('/manage/modules/sessions');
$location.path('/manage/modules/sessions/');
};
/**

View File

@@ -30,35 +30,43 @@
<!-- Home -->
<li>
<a class="home" ng-click="navigateHome()" ng-class="{disabled: homeDisabled}" href="#/">
<a class="home" ng-click="navigateHome()"
ng-class="{disabled: homeDisabled}" href="#/">
{{'USER_MENU.ACTION_NAVIGATE_HOME' | translate}}
</a>
</li>
<!-- Manage Users -->
<li>
<a class="manage-users" ng-click="manageUsers()" ng-class="{disabled: manageUsersDisabled}" ng-show="canManageUsers" href="#/manage/modules/users">
<a class="manage-users" ng-click="manageUsers()"
ng-class="{disabled: manageUsersDisabled}"
ng-show="canManageUsers" href="#/manage/modules/users/">
{{'USER_MENU.ACTION_MANAGE_USERS' | translate}}
</a>
</li>
<!-- Manage Connections -->
<li>
<a class="manage-connections" ng-click="manageConnections()" ng-class="{disabled: manageConnectionsDisabled}" ng-show="canManageConnections" href="#/manage/modules/connections">
<a class="manage-connections" ng-click="manageConnections()"
ng-class="{disabled: manageConnectionsDisabled}"
ng-show="canManageConnections" href="#/manage/modules/connections/">
{{'USER_MENU.ACTION_MANAGE_CONNECTIONS' | translate}}
</a>
</li>
<!-- Manage Sessions -->
<li>
<a class="manage-sessions" ng-click="manageSessions()" ng-class="{disabled: manageSessionsDisabled}" ng-show="canManageSessions" href="#/manage/modules/sessions">
<a class="manage-sessions" ng-click="manageSessions()"
ng-class="{disabled: manageSessionsDisabled}"
ng-show="canManageSessions" href="#/manage/modules/sessions/">
{{'USER_MENU.ACTION_MANAGE_SESSIONS' | translate}}
</a>
</li>
<!-- Change password -->
<li>
<a class="change-password" ng-click="showPasswordUpdate()" ng-show="canChangePassword">
<a class="change-password" ng-click="showPasswordUpdate()"
ng-show="canChangePassword">
{{'USER_MENU.ACTION_CHANGE_PASSWORD' | translate}}
</a>
</li>