mirror of
https://github.com/bitwarden/browser.git
synced 2024-10-31 08:20:37 +01:00
reinvite and remove org users
This commit is contained in:
parent
dde20f4451
commit
4499ec6a22
@ -7,6 +7,30 @@
|
||||
loadList();
|
||||
});
|
||||
|
||||
$scope.reinvite = function (user) {
|
||||
apiService.organizationUsers.reinvite({ orgId: $state.params.orgId, id: user.id }, null, function () {
|
||||
toastr.success(user.email + ' has been invited again.', 'User Invited');
|
||||
}, function () {
|
||||
toastr.error('Unable to invite user.', 'Error');
|
||||
});
|
||||
};
|
||||
|
||||
$scope.delete = function (user) {
|
||||
if (!confirm('Are you sure you want to remove this user (' + user.email + ')?')) {
|
||||
return;
|
||||
}
|
||||
|
||||
apiService.organizationUsers.del({ orgId: $state.params.orgId, id: user.id }, null, function () {
|
||||
toastr.success(user.email + ' has been removed.', 'User Removed');
|
||||
var index = $scope.users.indexOf(user);
|
||||
if (index > -1) {
|
||||
$scope.users.splice(index, 1);
|
||||
}
|
||||
}, function () {
|
||||
toastr.error('Unable to remove user.', 'Error');
|
||||
});
|
||||
};
|
||||
|
||||
$scope.confirm = function (user) {
|
||||
apiService.users.getPublicKey({ id: user.userId }, function (userKey) {
|
||||
var orgKey = cryptoService.getOrgKey($state.params.orgId);
|
||||
|
@ -31,8 +31,8 @@
|
||||
<li>
|
||||
<a href="javascript:void(0)" ng-click="confirm(user)">Confirm</a>
|
||||
</li>
|
||||
<li><a href="#">Re-send Invitation</a></li>
|
||||
<li><a href="#" class="text-danger">Remove</a></li>
|
||||
<li><a href="javascript:void(0)" ng-click="reinvite(user)">Re-send Invitation</a></li>
|
||||
<li><a href="javascript:void(0)" ng-click="delete(user)" class="text-danger">Remove</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
|
@ -43,6 +43,7 @@
|
||||
get: { method: 'GET', params: { id: '@id', orgId: '@orgId' } },
|
||||
list: { method: 'GET', params: { orgId: '@orgId' } },
|
||||
invite: { url: _apiUri + '/organizations/:orgId/users/invite', method: 'POST', params: { orgId: '@orgId' } },
|
||||
reinvite: { url: _apiUri + '/organizations/:orgId/users/:id/reinvite', method: 'POST', params: { id: '@id', orgId: '@orgId' } },
|
||||
accept: { url: _apiUri + '/organizations/:orgId/users/:id/accept', method: 'POST', params: { id: '@id', orgId: '@orgId' } },
|
||||
confirm: { url: _apiUri + '/organizations/:orgId/users/:id/confirm', method: 'POST', params: { id: '@id', orgId: '@orgId' } },
|
||||
put: { method: 'POST', params: { id: '@id', orgId: '@orgId' } },
|
||||
|
Loading…
Reference in New Issue
Block a user