From 7ce5464e52a84fcf7ae66892f41c70e10efe505f Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 29 Aug 2018 09:45:57 -0400 Subject: [PATCH] self hosted users get 1 TB --- src/Core/Services/Implementations/CipherService.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Core/Services/Implementations/CipherService.cs b/src/Core/Services/Implementations/CipherService.cs index 5aaf70edac..f560042666 100644 --- a/src/Core/Services/Implementations/CipherService.cs +++ b/src/Core/Services/Implementations/CipherService.cs @@ -25,6 +25,7 @@ namespace Bit.Core.Services private readonly IAttachmentStorageService _attachmentStorageService; private readonly IEventService _eventService; private readonly IUserService _userService; + private readonly GlobalSettings _globalSettings; public CipherService( ICipherRepository cipherRepository, @@ -37,7 +38,8 @@ namespace Bit.Core.Services IPushNotificationService pushService, IAttachmentStorageService attachmentStorageService, IEventService eventService, - IUserService userService) + IUserService userService, + GlobalSettings globalSettings) { _cipherRepository = cipherRepository; _folderRepository = folderRepository; @@ -50,6 +52,7 @@ namespace Bit.Core.Services _attachmentStorageService = attachmentStorageService; _eventService = eventService; _userService = userService; + _globalSettings = globalSettings; } public async Task SaveAsync(Cipher cipher, Guid savingUserId, bool orgAdmin = false) @@ -141,7 +144,8 @@ namespace Bit.Core.Services { // Users that get access to file storage/premium from their organization get the default // 1 GB max storage. - storageBytesRemaining = user.StorageBytesRemaining(1); + storageBytesRemaining = user.StorageBytesRemaining( + _globalSettings.SelfHosted ? (short)1024 : (short)1); } } else if(cipher.OrganizationId.HasValue)