diff --git a/src/app/vault/vaultAttachmentsController.js b/src/app/vault/vaultAttachmentsController.js index 52848f5055..20dc00e4d3 100644 --- a/src/app/vault/vaultAttachmentsController.js +++ b/src/app/vault/vaultAttachmentsController.js @@ -8,15 +8,16 @@ $scope.readOnly = true; $scope.loading = true; $scope.isPremium = true; + $scope.canUseAttachments = true; var closing = false; authService.getUserProfile().then(function (profile) { $scope.isPremium = profile.premium; - }); - - apiService.logins.get({ id: loginId }, function (login) { + return apiService.logins.get({ id: loginId }).$promise; + }).then(function (login) { $scope.login = cipherService.decryptLogin(login); $scope.readOnly = !login.Edit; + $scope.canUseAttachments = $scope.isPremium || $scope.login.organizationId; $scope.loading = false; }, function () { $scope.loading = false; @@ -57,7 +58,7 @@ $scope.download = function (attachment) { attachment.loading = true; - if (!$scope.login.organizationId && !$scope.isPremium) { + if (!$scope.canUseAttachments) { attachment.loading = false; alert('Premium membership is required to use this feature.'); return; diff --git a/src/app/vault/vaultController.js b/src/app/vault/vaultController.js index f291cf9b92..e3a2e16bbc 100644 --- a/src/app/vault/vaultController.js +++ b/src/app/vault/vaultController.js @@ -206,25 +206,27 @@ orgUseStorage: login.organizationId && !!profile.organizations[login.organizationId].maxStorageGb }; }).then(function (perms) { - if (login.organizationId && !perms.orgUseStorage) { - $uibModal.open({ - animation: true, - templateUrl: 'app/views/paidOrgRequired.html', - controller: 'paidOrgRequiredController', - resolve: { - orgId: function () { return login.organizationId; } - } - }); - return; - } + if (!login.hasAttachments) { + if (login.organizationId && !perms.orgUseStorage) { + $uibModal.open({ + animation: true, + templateUrl: 'app/views/paidOrgRequired.html', + controller: 'paidOrgRequiredController', + resolve: { + orgId: function () { return login.organizationId; } + } + }); + return; + } - if (!login.organizationId && !perms.isPremium) { - $uibModal.open({ - animation: true, - templateUrl: 'app/views/premiumRequired.html', - controller: 'premiumRequiredController' - }); - return; + if (!login.organizationId && !perms.isPremium) { + $uibModal.open({ + animation: true, + templateUrl: 'app/views/premiumRequired.html', + controller: 'premiumRequiredController' + }); + return; + } } if (!login.organizationId && !cryptoService.getEncKey()) { diff --git a/src/app/vault/views/vaultAttachments.html b/src/app/vault/views/vaultAttachments.html index c16fd96e26..0f4f0125e7 100644 --- a/src/app/vault/views/vaultAttachments.html +++ b/src/app/vault/views/vaultAttachments.html @@ -48,7 +48,7 @@

Add New Attachment

-
+

Premium Membership Required

Premium membership is required to use this feature.

@@ -59,7 +59,7 @@
  • {{e}}
  • -
    +

    Maximum size per file is 100 MB.

    @@ -67,7 +67,7 @@