diff --git a/src/app/organization/organizationVaultAttachmentsController.js b/src/app/organization/organizationVaultAttachmentsController.js index cc98847b222..fe5c27a7ef7 100644 --- a/src/app/organization/organizationVaultAttachmentsController.js +++ b/src/app/organization/organizationVaultAttachmentsController.js @@ -6,6 +6,7 @@ $analytics.eventTrack('organizationVaultAttachmentsController', { category: 'Modal' }); $scope.login = {}; $scope.loading = true; + $scope.isPremium = true; var closing = false; apiService.logins.getAdmin({ id: loginId }, function (login) { diff --git a/src/app/vault/vaultAttachmentsController.js b/src/app/vault/vaultAttachmentsController.js index 856052b90fb..52848f50556 100644 --- a/src/app/vault/vaultAttachmentsController.js +++ b/src/app/vault/vaultAttachmentsController.js @@ -2,13 +2,18 @@ .module('bit.vault') .controller('vaultAttachmentsController', function ($scope, apiService, $uibModalInstance, cryptoService, cipherService, - loginId, $analytics, validationService, toastr, $timeout) { + loginId, $analytics, validationService, toastr, $timeout, authService, $uibModal) { $analytics.eventTrack('vaultAttachmentsController', { category: 'Modal' }); $scope.login = {}; $scope.readOnly = true; $scope.loading = true; + $scope.isPremium = true; var closing = false; + authService.getUserProfile().then(function (profile) { + $scope.isPremium = profile.premium; + }); + apiService.logins.get({ id: loginId }, function (login) { $scope.login = cipherService.decryptLogin(login); $scope.readOnly = !login.Edit; @@ -51,6 +56,13 @@ $scope.download = function (attachment) { attachment.loading = true; + + if (!$scope.login.organizationId && !$scope.isPremium) { + attachment.loading = false; + alert('Premium membership is required to use this feature.'); + return; + } + cipherService.downloadAndDecryptAttachment(getKeyForLogin(), attachment, true).then(function (res) { $timeout(function () { attachment.loading = false; @@ -102,4 +114,12 @@ closing = true; $uibModalInstance.close(!!$scope.login.attachments && $scope.login.attachments.length > 0); }); + + $scope.showUpgrade = function () { + $uibModal.open({ + animation: true, + templateUrl: 'app/views/premiumRequired.html', + controller: 'premiumRequiredController' + }); + }; }); diff --git a/src/app/vault/views/vaultAttachments.html b/src/app/vault/views/vaultAttachments.html index 46d5ac70b6d..c16fd96e26d 100644 --- a/src/app/vault/views/vaultAttachments.html +++ b/src/app/vault/views/vaultAttachments.html @@ -48,13 +48,18 @@
Premium membership is required to use this feature.
+ +Maximum size per file is 100 MB.
@@ -62,7 +67,7 @@