From 0983a35cf3aee24219bf604bfc17c809e87ba62f Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 29 Aug 2018 09:08:05 -0400 Subject: [PATCH] storageBytesRemaining by way of users get premium --- src/Core/Services/Implementations/CipherService.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Core/Services/Implementations/CipherService.cs b/src/Core/Services/Implementations/CipherService.cs index 8a0f960ffb..5aaf70edac 100644 --- a/src/Core/Services/Implementations/CipherService.cs +++ b/src/Core/Services/Implementations/CipherService.cs @@ -133,7 +133,16 @@ namespace Bit.Core.Services throw new BadRequestException("You must have premium status to use attachments."); } - storageBytesRemaining = user.StorageBytesRemaining(); + if(user.Premium) + { + storageBytesRemaining = user.StorageBytesRemaining(); + } + else + { + // Users that get access to file storage/premium from their organization get the default + // 1 GB max storage. + storageBytesRemaining = user.StorageBytesRemaining(1); + } } else if(cipher.OrganizationId.HasValue) {