1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-18 16:11:28 -05:00

remove admin checks from services for ctrl context

This commit is contained in:
Kyle Spearrin
2017-04-05 16:29:46 -04:00
parent 9a1e512020
commit c4ab901098
6 changed files with 48 additions and 76 deletions

View File

@ -9,7 +9,6 @@ namespace Bit.Core.Repositories
{
public interface IOrganizationUserRepository : IRepository<OrganizationUser, Guid>
{
Task<OrganizationUser> GetByOrganizationAsync(Guid organizationId, Guid userId);
Task<ICollection<OrganizationUser>> GetManyByUserAsync(Guid userId);
Task<ICollection<OrganizationUser>> GetManyByOrganizationAsync(Guid organizationId, OrganizationUserType? type);
Task<OrganizationUser> GetByOrganizationAsync(Guid organizationId, string email);

View File

@ -21,19 +21,6 @@ namespace Bit.Core.Repositories.SqlServer
: base(connectionString)
{ }
public async Task<OrganizationUser> GetByOrganizationAsync(Guid organizationId, Guid userId)
{
using(var connection = new SqlConnection(ConnectionString))
{
var results = await connection.QueryAsync<OrganizationUser>(
"[dbo].[OrganizationUser_ReadByOrganizationIdUserId]",
new { OrganizationId = organizationId, UserId = userId },
commandType: CommandType.StoredProcedure);
return results.SingleOrDefault();
}
}
public async Task<OrganizationUser> GetByOrganizationAsync(Guid organizationId, string email)
{
using(var connection = new SqlConnection(ConnectionString))