1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-17 23:50:58 -05:00

org context checks in org apis. remove depr. code

This commit is contained in:
Kyle Spearrin
2017-04-05 16:13:40 -04:00
parent a474449354
commit 9a1e512020
8 changed files with 69 additions and 82 deletions

View File

@ -7,7 +7,6 @@ namespace Bit.Core.Repositories
{
public interface IOrganizationRepository : IRepository<Organization, Guid>
{
Task<Organization> GetByIdAsync(Guid id, Guid userId);
Task<ICollection<Organization>> GetManyByUserIdAsync(Guid userId);
}
}

View File

@ -19,19 +19,6 @@ namespace Bit.Core.Repositories.SqlServer
: base(connectionString)
{ }
public async Task<Organization> GetByIdAsync(Guid id, Guid userId)
{
using(var connection = new SqlConnection(ConnectionString))
{
var results = await connection.QueryAsync<Organization>(
"[dbo].[Organization_ReadByIdUserId]",
new { Id = id, UserId = userId },
commandType: CommandType.StoredProcedure);
return results.SingleOrDefault();
}
}
public async Task<ICollection<Organization>> GetManyByUserIdAsync(Guid userId)
{
using(var connection = new SqlConnection(ConnectionString))