1
0
mirror of https://github.com/bitwarden/server synced 2025-12-25 04:33:26 +00:00

Admins are not limited by collection controls

This commit is contained in:
Kyle Spearrin
2017-09-06 13:01:22 -04:00
parent 06bdda5717
commit b06aae7cfd
8 changed files with 48 additions and 8 deletions

View File

@@ -36,6 +36,19 @@ namespace Bit.Core.Repositories.SqlServer
}
}
public async Task<CipherDetails> GetDetailsByIdAsync(Guid id)
{
using(var connection = new SqlConnection(ConnectionString))
{
var results = await connection.QueryAsync<CipherDetails>(
$"[{Schema}].[CipherDetails_ReadById]",
new { Id = id },
commandType: CommandType.StoredProcedure);
return results.FirstOrDefault();
}
}
public async Task<bool> GetCanEditByIdAsync(Guid userId, Guid cipherId)
{
using(var connection = new SqlConnection(ConnectionString))
@@ -401,7 +414,7 @@ namespace Bit.Core.Repositories.SqlServer
}
}
public async Task CreateAsync(IEnumerable<Cipher> ciphers, IEnumerable<Collection> collections,
public async Task CreateAsync(IEnumerable<Cipher> ciphers, IEnumerable<Collection> collections,
IEnumerable<CollectionCipher> collectionCiphers)
{
if(!ciphers.Any())