1
0
mirror of https://github.com/bitwarden/web synced 2026-01-02 08:33:18 +00:00

subvault => collections file renames

This commit is contained in:
Kyle Spearrin
2017-04-27 09:35:21 -04:00
parent 1ebae5c284
commit 4eee908f2f
16 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
angular
.module('bit.organization')
.controller('organizationCollectionsUsersController', function ($scope, $state, $uibModalInstance, apiService, cipherService,
$analytics, collection, toastr) {
$analytics.eventTrack('organizationCollectionsUsersController', { category: 'Modal' });
$scope.loading = true;
$scope.collection = collection;
$scope.users = [];
$uibModalInstance.opened.then(function () {
$scope.loading = false;
apiService.collectionUsers.listCollection(
{
orgId: $state.params.orgId,
collectionId: collection.id
},
function (userList) {
if (userList && userList.Data.length) {
var users = [];
for (var i = 0; i < userList.Data.length; i++) {
users.push({
id: userList.Data[i].Id,
userId: userList.Data[i].UserId,
name: userList.Data[i].Name,
email: userList.Data[i].Email,
type: userList.Data[i].Type,
status: userList.Data[i].Status,
readOnly: userList.Data[i].ReadOnly,
accessAllCollections: userList.Data[i].AccessAllCollections
});
}
$scope.users = users;
}
});
});
$scope.remove = function (user) {
if (!confirm('Are you sure you want to remove this user (' + user.email + ') from this ' +
'collection (' + collection.name + ')?')) {
return;
}
apiService.collectionUsers.del({ orgId: $state.params.orgId, id: user.id }, null, function () {
toastr.success(user.email + ' has been removed.', 'User Removed');
$analytics.eventTrack('Removed User From Collection');
var index = $scope.users.indexOf(user);
if (index > -1) {
$scope.users.splice(index, 1);
}
}, function () {
toastr.error('Unable to remove user.', 'Error');
});
};
$scope.close = function () {
$uibModalInstance.dismiss('cancel');
};
});