1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 16:12:49 -05:00

self hosted users get 1 TB

This commit is contained in:
Kyle Spearrin
2018-08-29 09:45:57 -04:00
parent 2972f7789f
commit 7ce5464e52

View File

@ -25,6 +25,7 @@ namespace Bit.Core.Services
private readonly IAttachmentStorageService _attachmentStorageService; private readonly IAttachmentStorageService _attachmentStorageService;
private readonly IEventService _eventService; private readonly IEventService _eventService;
private readonly IUserService _userService; private readonly IUserService _userService;
private readonly GlobalSettings _globalSettings;
public CipherService( public CipherService(
ICipherRepository cipherRepository, ICipherRepository cipherRepository,
@ -37,7 +38,8 @@ namespace Bit.Core.Services
IPushNotificationService pushService, IPushNotificationService pushService,
IAttachmentStorageService attachmentStorageService, IAttachmentStorageService attachmentStorageService,
IEventService eventService, IEventService eventService,
IUserService userService) IUserService userService,
GlobalSettings globalSettings)
{ {
_cipherRepository = cipherRepository; _cipherRepository = cipherRepository;
_folderRepository = folderRepository; _folderRepository = folderRepository;
@ -50,6 +52,7 @@ namespace Bit.Core.Services
_attachmentStorageService = attachmentStorageService; _attachmentStorageService = attachmentStorageService;
_eventService = eventService; _eventService = eventService;
_userService = userService; _userService = userService;
_globalSettings = globalSettings;
} }
public async Task SaveAsync(Cipher cipher, Guid savingUserId, bool orgAdmin = false) 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 // Users that get access to file storage/premium from their organization get the default
// 1 GB max storage. // 1 GB max storage.
storageBytesRemaining = user.StorageBytesRemaining(1); storageBytesRemaining = user.StorageBytesRemaining(
_globalSettings.SelfHosted ? (short)1024 : (short)1);
} }
} }
else if(cipher.OrganizationId.HasValue) else if(cipher.OrganizationId.HasValue)