mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 07:36:14 -05:00
fix issues on cipher admin endpoints
This commit is contained in:
@ -1,13 +1,11 @@
|
||||
using Bit.Core.Models.Table;
|
||||
using System;
|
||||
using System;
|
||||
|
||||
namespace Core.Models.Data
|
||||
{
|
||||
public class CipherDetails : Cipher
|
||||
public class CipherDetails : CipherOrganizationDetails
|
||||
{
|
||||
public Guid? FolderId { get; set; }
|
||||
public bool Favorite { get; set; }
|
||||
public bool Edit { get; set; }
|
||||
public bool OrganizationUseTotp { get; set; }
|
||||
}
|
||||
}
|
||||
|
9
src/Core/Models/Data/CipherOrganizationDetails.cs
Normal file
9
src/Core/Models/Data/CipherOrganizationDetails.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using Bit.Core.Models.Table;
|
||||
|
||||
namespace Core.Models.Data
|
||||
{
|
||||
public class CipherOrganizationDetails : Cipher
|
||||
{
|
||||
public bool OrganizationUseTotp { get; set; }
|
||||
}
|
||||
}
|
@ -10,7 +10,7 @@ namespace Bit.Core.Repositories
|
||||
public interface ICipherRepository : IRepository<Cipher, Guid>
|
||||
{
|
||||
Task<CipherDetails> GetByIdAsync(Guid id, Guid userId);
|
||||
Task<CipherDetails> GetDetailsByIdAsync(Guid id);
|
||||
Task<CipherOrganizationDetails> GetOrganizationDetailsByIdAsync(Guid id);
|
||||
Task<bool> GetCanEditByIdAsync(Guid userId, Guid cipherId);
|
||||
Task<ICollection<CipherDetails>> GetManyByUserIdAsync(Guid userId, bool withOrganizations = true);
|
||||
Task<ICollection<Cipher>> GetManyByOrganizationIdAsync(Guid organizationId);
|
||||
|
@ -36,12 +36,12 @@ namespace Bit.Core.Repositories.SqlServer
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<CipherDetails> GetDetailsByIdAsync(Guid id)
|
||||
public async Task<CipherOrganizationDetails> GetOrganizationDetailsByIdAsync(Guid id)
|
||||
{
|
||||
using(var connection = new SqlConnection(ConnectionString))
|
||||
{
|
||||
var results = await connection.QueryAsync<CipherDetails>(
|
||||
$"[{Schema}].[CipherDetails_ReadById]",
|
||||
$"[{Schema}].[CipherOrganizationDetails_ReadById]",
|
||||
new { Id = id },
|
||||
commandType: CommandType.StoredProcedure);
|
||||
|
||||
|
Reference in New Issue
Block a user