From 4ba21638b1c337d31390ec513860c8abe6ae8a0d Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 20 Apr 2017 22:19:18 -0400 Subject: [PATCH] access all subvaults option for org users --- .../organizationPeopleEditController.js | 12 ++- .../organizationPeopleInviteController.js | 12 ++- .../views/organizationPeopleEdit.html | 96 +++++++++++-------- .../views/organizationPeopleInvite.html | 96 +++++++++++-------- 4 files changed, 128 insertions(+), 88 deletions(-) diff --git a/src/app/organization/organizationPeopleEditController.js b/src/app/organization/organizationPeopleEditController.js index 42de6b5a28..72c1e1c2b9 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 9183a429a1..4915051d60 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 943079f4ab..f6c63c290e 100644 --- a/src/app/organization/views/organizationPeopleEdit.html +++ b/src/app/organization/views/organizationPeopleEdit.html @@ -32,48 +32,64 @@

Subvault Access

-
- Loading... +
+
-
-

No subvaults for your organization.

+
+
-
- - - - - - - - - - - - - - - -
- - NameRead Only
- - - {{subvault.name}} - - -
+
+
+ Loading subvaults... +
+
+

No subvaults for your organization.

+
+
+ + + + + + + + + + + + + + + +
+ + NameRead Only
+ + + {{subvault.name}} + + +
+

Subvault Access

-
- Loading... +
+
-
-

No subvaults for your organization.

+
+
-
- - - - - - - - - - - - - - - -
- - NameRead Only
- - - {{subvault.name}} - - -
+
+
+ Loading subvaults... +
+
+

No subvaults for your organization.

+
+
+ + + + + + + + + + + + + + + +
+ + NameRead Only
+ + + {{subvault.name}} + + +
+