GUAC-1078 Added clone functionality for connections and fixed some bugs around button showing for connections, groups, and users.

This commit is contained in:
James Muehlner
2015-02-18 21:20:36 -08:00
parent 7d65b4a024
commit 024b1c8ec5
7 changed files with 110 additions and 45 deletions

View File

@@ -105,8 +105,8 @@ angular.module('manage').controller('manageUserController', ['$scope', '$injecto
return $scope.user !== null
&& $scope.permissionFlags !== null
&& $scope.rootGroup !== null
&& $scope.hasUpdatePermission !== null
&& $scope.hasDeletePermission !== null;
&& $scope.canSaveUser !== null
&& $scope.canDeleteUser !== null;
};
@@ -130,16 +130,19 @@ angular.module('manage').controller('manageUserController', ['$scope', '$injecto
permissionService.getPermissions(authenticationService.getCurrentUserID())
.success(function permissionsReceived(permissions) {
// Check if the user has UPDATE permission
$scope.hasUpdatePermission =
PermissionSet.hasSystemPermission(permissions, PermissionSet.SystemPermissionType.ADMINISTER)
|| PermissionSet.hasUserPermission(permissions, PermissionSet.ObjectPermissionType.UPDATE, username);
// Check if the user has DELETE permission
$scope.hasDeletePermission =
PermissionSet.hasSystemPermission(permissions, PermissionSet.SystemPermissionType.ADMINISTER)
|| PermissionSet.hasUserPermission(permissions, PermissionSet.ObjectPermissionType.DELETE, username);
// Check if the user is new or if the user has UPDATE permission
$scope.canSaveUser =
!username
|| PermissionSet.hasSystemPermission(permissions, PermissionSet.SystemPermissionType.ADMINISTER)
|| PermissionSet.hasUserPermission(permissions, PermissionSet.ObjectPermissionType.UPDATE, username);
// Check if user is not new and the user has DELETE permission
$scope.canDeleteUser =
!!username && (
PermissionSet.hasSystemPermission(permissions, PermissionSet.SystemPermissionType.ADMINISTER)
|| PermissionSet.hasUserPermission(permissions, PermissionSet.ObjectPermissionType.DELETE, username)
);
});
/**