mirror of
https://github.com/nextcloud/passman.git
synced 2025-10-08 20:46:12 +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.
|
//@TODO Improve this so we can add, edit and remove users and permissions.
|
||||||
$scope.inputSharedWith = [];
|
$scope.inputSharedWith = [];
|
||||||
if(shareWith.length > 0) {
|
if(shareWith.length > 0) {
|
||||||
shareWithMainLoop:
|
|
||||||
for (var i = 0; i < shareWith.length; i++) {
|
for (var i = 0; i < shareWith.length; i++) {
|
||||||
// Avoid adding twice the same user.
|
// 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 = {
|
var obj = {
|
||||||
userId: shareWith[i].uid,
|
userId: shareWith[i].uid,
|
||||||
displayName: shareWith[i].text,
|
displayName: shareWith[i].text,
|
||||||
type: shareWith[i].type,
|
type: shareWith[i].type,
|
||||||
accessLevel: selectedAccessLevel
|
accessLevel: selectedAccessLevel
|
||||||
};
|
};
|
||||||
// if (obj.type == 'group') obj.users = shareWith[i].users;
|
if($scope.share_settings.credentialSharedWithUserAndGroup.indexOf(obj) === -1){
|
||||||
$scope.share_settings.credentialSharedWithUserAndGroup.push(
|
$scope.share_settings.credentialSharedWithUserAndGroup.push(obj)
|
||||||
obj
|
}
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue