1
0
mirror of https://github.com/bitwarden/server.git synced 2025-05-23 04:21:05 -05:00

exclude domains from sync option

This commit is contained in:
Kyle Spearrin 2018-06-25 21:29:04 -04:00
parent 3bf468c545
commit 826b4a430f
2 changed files with 5 additions and 4 deletions

View File

@ -46,7 +46,7 @@ namespace Bit.Api.Controllers
} }
[HttpGet("")] [HttpGet("")]
public async Task<SyncResponseModel> Get() public async Task<SyncResponseModel> Get([FromQuery]bool excludeDomains = false)
{ {
var user = await _userService.GetUserByPrincipalAsync(User); var user = await _userService.GetUserByPrincipalAsync(User);
if(user == null) if(user == null)
@ -70,7 +70,7 @@ namespace Bit.Api.Controllers
} }
var response = new SyncResponseModel(_globalSettings, user, organizationUserDetails, folders, var response = new SyncResponseModel(_globalSettings, user, organizationUserDetails, folders,
collections, ciphers, collectionCiphersGroupDict); collections, ciphers, collectionCiphersGroupDict, excludeDomains);
return response; return response;
} }
} }

View File

@ -16,7 +16,8 @@ namespace Bit.Core.Models.Api
IEnumerable<Folder> folders, IEnumerable<Folder> folders,
IEnumerable<CollectionDetails> collections, IEnumerable<CollectionDetails> collections,
IEnumerable<CipherDetails> ciphers, IEnumerable<CipherDetails> ciphers,
IDictionary<Guid, IGrouping<Guid, CollectionCipher>> collectionCiphersDict) IDictionary<Guid, IGrouping<Guid, CollectionCipher>> collectionCiphersDict,
bool excludeDomains)
: base("sync") : base("sync")
{ {
Profile = new ProfileResponseModel(user, organizationUserDetails); Profile = new ProfileResponseModel(user, organizationUserDetails);
@ -24,7 +25,7 @@ namespace Bit.Core.Models.Api
Ciphers = ciphers.Select(c => new CipherDetailsResponseModel(c, globalSettings, collectionCiphersDict)); Ciphers = ciphers.Select(c => new CipherDetailsResponseModel(c, globalSettings, collectionCiphersDict));
Collections = collections?.Select( Collections = collections?.Select(
c => new CollectionDetailsResponseModel(c)) ?? new List<CollectionDetailsResponseModel>(); c => new CollectionDetailsResponseModel(c)) ?? new List<CollectionDetailsResponseModel>();
Domains = new DomainsResponseModel(user, false); Domains = excludeDomains ? null : new DomainsResponseModel(user, false);
} }
public ProfileResponseModel Profile { get; set; } public ProfileResponseModel Profile { get; set; }