GUACAMOLE-5: Replace UserRESTService with new resource-driven implementation.

This commit is contained in:
Michael Jumper
2016-07-12 13:01:42 -07:00
parent 61d581ef0d
commit 374ad3eb23
9 changed files with 592 additions and 651 deletions

View File

@@ -50,9 +50,10 @@ angular.module('rest').factory('userService', ['$injector',
* If null, no filtering will be performed. Valid values are listed
* within PermissionSet.ObjectType.
*
* @returns {Promise.<User[]>}
* A promise which will resolve with an array of @link{User} objects
* upon success.
* @returns {Promise.<Object.<String, User>>}
* A promise which will resolve with a map of @link{User} objects
* where each key is the identifier (username) of the corresponding
* user.
*/
service.getUsers = function getUsers(dataSource, permissionTypes) {

View File

@@ -227,14 +227,14 @@ angular.module('settings').directive('guacSettingsUsers', [function guacSettings
PermissionSet.ObjectPermissionType.DELETE
]);
userPromise.then(function usersReceived(userArrays) {
userPromise.then(function usersReceived(allUsers) {
var addedUsers = {};
$scope.manageableUsers = [];
// For each user in each data source
angular.forEach(dataSources, function addUserList(dataSource) {
angular.forEach(userArrays[dataSource], function addUser(user) {
angular.forEach(allUsers[dataSource], function addUser(user) {
// Do not add the same user twice
if (addedUsers[user.username])