GUAC-586: Only provide password change interface for the data source that authenticated the current user.

This commit is contained in:
Michael Jumper
2015-08-27 23:50:16 -07:00
parent e75ab6ebd5
commit f892446e03

View File

@@ -66,6 +66,14 @@ angular.module('settings').directive('guacSettingsPreferences', [function guacSe
*/ */
var username = authenticationService.getCurrentUsername(); var username = authenticationService.getCurrentUsername();
/**
* The identifier of the data source which authenticated the
* current user.
*
* @type String
*/
var dataSource = authenticationService.getDataSource();
/** /**
* All currently-set preferences, or their defaults if not yet set. * All currently-set preferences, or their defaults if not yet set.
* *
@@ -140,7 +148,7 @@ angular.module('settings').directive('guacSettingsPreferences', [function guacSe
} }
// Save the user with the new password // Save the user with the new password
userService.updateUserPassword(username, $scope.oldPassword, $scope.newPassword) userService.updateUserPassword(dataSource, username, $scope.oldPassword, $scope.newPassword)
.success(function passwordUpdated() { .success(function passwordUpdated() {
// Clear the password fields // Clear the password fields
@@ -174,7 +182,7 @@ angular.module('settings').directive('guacSettingsPreferences', [function guacSe
}); });
// Retrieve current permissions // Retrieve current permissions
permissionService.getPermissions(username) permissionService.getPermissions(dataSource, username)
.success(function permissionsRetrieved(permissions) { .success(function permissionsRetrieved(permissions) {
// Add action for changing password if permission is granted // Add action for changing password if permission is granted