mirror of
https://github.com/nextcloud/passman.git
synced 2025-02-23 23:14:11 +08:00
Fix add multiple users to shared credential
This commit is contained in:
parent
326f9dcac7
commit
79d0bc76a3
1 changed files with 3 additions and 10 deletions
|
@ -100,24 +100,17 @@ angular.module('passmanApp')
|
|||
//@TODO Improve this so we can add, edit and remove users and permissions.
|
||||
$scope.inputSharedWith = [];
|
||||
if(shareWith.length > 0) {
|
||||
shareWithMainLoop:
|
||||
for (var i = 0; i < shareWith.length; i++) {
|
||||
// Avoid adding twice the same user.
|
||||
for (var x = 0; x < $scope.share_settings.credentialSharedWithUserAndGroup.length; x++){
|
||||
if (shareWith[x].uid == $scope.share_settings.credentialSharedWithUserAndGroup[i].userId){
|
||||
continue shareWithMainLoop;
|
||||
}
|
||||
}
|
||||
var obj = {
|
||||
userId: shareWith[i].uid,
|
||||
displayName: shareWith[i].text,
|
||||
type: shareWith[i].type,
|
||||
accessLevel: selectedAccessLevel
|
||||
};
|
||||
// if (obj.type == 'group') obj.users = shareWith[i].users;
|
||||
$scope.share_settings.credentialSharedWithUserAndGroup.push(
|
||||
obj
|
||||
)
|
||||
if($scope.share_settings.credentialSharedWithUserAndGroup.indexOf(obj) === -1){
|
||||
$scope.share_settings.credentialSharedWithUserAndGroup.push(obj)
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue