diff --git a/src/app/organization/organizationPeopleEditController.js b/src/app/organization/organizationPeopleEditController.js index 42de6b5a281..72c1e1c2b91 100644 --- a/src/app/organization/organizationPeopleEditController.js +++ b/src/app/organization/organizationPeopleEditController.js @@ -24,6 +24,7 @@ } $scope.email = user.Email; $scope.type = user.Type; + $scope.accessAllSubvaults = user.AccessAllSubvaults; $scope.selectedSubvaults = subvaults; }); }); @@ -72,15 +73,18 @@ $scope.submitPromise = null; $scope.submit = function (model) { var subvaults = []; - for (var subvaultId in $scope.selectedSubvaults) { - if ($scope.selectedSubvaults.hasOwnProperty(subvaultId)) { - subvaults.push($scope.selectedSubvaults[subvaultId]); + if (!$scope.accessAllSubvaults) { + for (var subvaultId in $scope.selectedSubvaults) { + if ($scope.selectedSubvaults.hasOwnProperty(subvaultId)) { + subvaults.push($scope.selectedSubvaults[subvaultId]); + } } } $scope.submitPromise = apiService.organizationUsers.put({ orgId: $state.params.orgId, id: id }, { type: $scope.type, - subvaults: subvaults + subvaults: subvaults, + accessAllSubvaults: $scope.accessAllSubvaults }, function () { $uibModalInstance.close(); }).$promise; diff --git a/src/app/organization/organizationPeopleInviteController.js b/src/app/organization/organizationPeopleInviteController.js index 9183a429a1d..4915051d606 100644 --- a/src/app/organization/organizationPeopleInviteController.js +++ b/src/app/organization/organizationPeopleInviteController.js @@ -60,16 +60,20 @@ $scope.submitPromise = null; $scope.submit = function (model) { var subvaults = []; - for (var subvaultId in $scope.selectedSubvaults) { - if ($scope.selectedSubvaults.hasOwnProperty(subvaultId)) { - subvaults.push($scope.selectedSubvaults[subvaultId]); + + if (!model.accessAllSubvaults) { + for (var subvaultId in $scope.selectedSubvaults) { + if ($scope.selectedSubvaults.hasOwnProperty(subvaultId)) { + subvaults.push($scope.selectedSubvaults[subvaultId]); + } } } $scope.submitPromise = apiService.organizationUsers.invite({ orgId: $state.params.orgId }, { email: model.email, type: model.type, - subvaults: subvaults + subvaults: subvaults, + accessAllSubvaults: model.accessAllSubvaults }, function () { $uibModalInstance.close(); }).$promise; diff --git a/src/app/organization/views/organizationPeopleEdit.html b/src/app/organization/views/organizationPeopleEdit.html index 943079f4abf..f6c63c290ef 100644 --- a/src/app/organization/views/organizationPeopleEdit.html +++ b/src/app/organization/views/organizationPeopleEdit.html @@ -32,48 +32,64 @@
No subvaults for your organization.
+| - - | -Name | -Read Only | -
|---|---|---|
| - - | -- {{subvault.name}} - | -- - | -
No subvaults for your organization.
+| + + | +Name | +Read Only | +
|---|---|---|
| + + | ++ {{subvault.name}} + | ++ + | +
No subvaults for your organization.
+| - - | -Name | -Read Only | -
|---|---|---|
| - - | -- {{subvault.name}} - | -- - | -
No subvaults for your organization.
+| + + | +Name | +Read Only | +
|---|---|---|
| + + | ++ {{subvault.name}} + | ++ + | +