mirror of
https://github.com/bitwarden/server.git
synced 2024-11-26 12:55:17 +01:00
only impose import limits on cloud version
This commit is contained in:
parent
f5c9672370
commit
8ce0f85fe8
@ -198,7 +198,9 @@ namespace Bit.Api.Controllers
|
||||
[HttpPost("import")]
|
||||
public async Task PostImport([FromBody]ImportCiphersRequestModel model)
|
||||
{
|
||||
if(model.Ciphers.Count() > 5000 || model.FolderRelationships.Count() > 5000 || model.Folders.Count() > 200)
|
||||
if(!_globalSettings.SelfHosted &&
|
||||
(model.Ciphers.Count() > 5000 || model.FolderRelationships.Count() > 5000 ||
|
||||
model.Folders.Count() > 200))
|
||||
{
|
||||
throw new BadRequestException("You cannot import this much data at once.");
|
||||
}
|
||||
@ -212,7 +214,9 @@ namespace Bit.Api.Controllers
|
||||
[HttpPost("import-organization")]
|
||||
public async Task PostImport([FromQuery]string organizationId, [FromBody]ImportOrganizationCiphersRequestModel model)
|
||||
{
|
||||
if(model.Ciphers.Count() > 5000 || model.CollectionRelationships.Count() > 5000 || model.Collections.Count() > 200)
|
||||
if(!_globalSettings.SelfHosted &&
|
||||
(model.Ciphers.Count() > 5000 || model.CollectionRelationships.Count() > 5000 ||
|
||||
model.Collections.Count() > 200))
|
||||
{
|
||||
throw new BadRequestException("You cannot import this much data at once.");
|
||||
}
|
||||
|
@ -390,7 +390,7 @@ namespace Bit.Api.Controllers
|
||||
[HttpPost("{id}/import")]
|
||||
public async Task Import(string id, [FromBody]ImportOrganizationUsersRequestModel model)
|
||||
{
|
||||
if(model.Groups.Count() > 200 || model.Users.Count() > 1000)
|
||||
if(!_globalSettings.SelfHosted && (model.Groups.Count() > 200 || model.Users.Count() > 1000))
|
||||
{
|
||||
throw new BadRequestException("You cannot import this much data at once.");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user