mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-09 22:51:22 +00:00
GUAC-586: Add data source to user and permissions services.
This commit is contained in:
@@ -62,6 +62,15 @@ angular.module('settings').directive('guacSettingsUsers', [function guacSettings
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* The data source from which the list of users should be pulled.
|
||||
* For the time being, this is just the data source which
|
||||
* authenticated the current user.
|
||||
*
|
||||
* @type String
|
||||
*/
|
||||
$scope.dataSource = authenticationService.getDataSource();
|
||||
|
||||
/**
|
||||
* All visible users.
|
||||
*
|
||||
@@ -118,7 +127,7 @@ angular.module('settings').directive('guacSettingsUsers', [function guacSettings
|
||||
};
|
||||
|
||||
// Retrieve current permissions
|
||||
permissionService.getPermissions(currentUsername)
|
||||
permissionService.getPermissions($scope.dataSource, currentUsername)
|
||||
.success(function permissionsRetrieved(permissions) {
|
||||
|
||||
$scope.permissions = permissions;
|
||||
@@ -141,8 +150,10 @@ angular.module('settings').directive('guacSettingsUsers', [function guacSettings
|
||||
});
|
||||
|
||||
// Retrieve all users for whom we have UPDATE or DELETE permission
|
||||
userService.getUsers([PermissionSet.ObjectPermissionType.UPDATE,
|
||||
PermissionSet.ObjectPermissionType.DELETE])
|
||||
userService.getUsers($scope.dataSource, [
|
||||
PermissionSet.ObjectPermissionType.UPDATE,
|
||||
PermissionSet.ObjectPermissionType.DELETE
|
||||
])
|
||||
.success(function usersReceived(users) {
|
||||
|
||||
// Display only other users, not self
|
||||
@@ -164,7 +175,7 @@ angular.module('settings').directive('guacSettingsUsers', [function guacSettings
|
||||
});
|
||||
|
||||
// Create specified user
|
||||
userService.createUser(user)
|
||||
userService.createUser($scope.dataSource, user)
|
||||
|
||||
// Add user to visible list upon success
|
||||
.success(function userCreated() {
|
||||
|
Reference in New Issue
Block a user