From 528a0732a63ea09ece567a03d12f85e9365b962a Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 24 Apr 2018 20:19:23 -0400 Subject: [PATCH] use withOrganizations sproc --- src/Api/Controllers/CiphersController.cs | 3 ++- src/Core/Repositories/SqlServer/CipherRepository.cs | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Api/Controllers/CiphersController.cs b/src/Api/Controllers/CiphersController.cs index 3ec2cbb897..e82b3d26f9 100644 --- a/src/Api/Controllers/CiphersController.cs +++ b/src/Api/Controllers/CiphersController.cs @@ -90,7 +90,8 @@ namespace Bit.Api.Controllers { var userId = _userService.GetProperUserId(User).Value; var hasOrgs = _currentContext.Organizations.Any(); - var ciphers = await _cipherRepository.GetManyByUserIdAsync(userId, hasOrgs); + // TODO: Use hasOrgs proper for cipher listing here? + var ciphers = await _cipherRepository.GetManyByUserIdAsync(userId, true || hasOrgs); Dictionary> collectionCiphersGroupDict = null; if(hasOrgs) { diff --git a/src/Core/Repositories/SqlServer/CipherRepository.cs b/src/Core/Repositories/SqlServer/CipherRepository.cs index dcf2072509..5779541b55 100644 --- a/src/Core/Repositories/SqlServer/CipherRepository.cs +++ b/src/Core/Repositories/SqlServer/CipherRepository.cs @@ -65,9 +65,7 @@ namespace Bit.Core.Repositories.SqlServer public async Task> GetManyByUserIdAsync(Guid userId, bool withOrganizations = true) { string sprocName = null; - // Always "with organizations" for now. Future TODO is to possibly move to another, simpler sproc when no - // orgs are expected. - if(true || withOrganizations) + if(withOrganizations) { sprocName = $"[{Schema}].[CipherDetails_ReadByUserId]"; }