1
0
mirror of https://github.com/bitwarden/server synced 2025-12-25 12:43:14 +00:00

permission checks for cipher crud operations

This commit is contained in:
Kyle Spearrin
2017-03-24 09:27:15 -04:00
parent 0dae19bd4f
commit 10c72fafda
10 changed files with 78 additions and 11 deletions

View File

@@ -60,5 +60,18 @@ namespace Bit.Core.Repositories.SqlServer
return results.ToList();
}
}
public async Task<bool> GetIsAdminByUserIdCipherIdAsync(Guid userId, Guid cipherId)
{
using(var connection = new SqlConnection(ConnectionString))
{
var result = await connection.QueryFirstOrDefaultAsync<bool>(
$"[{Schema}].[SubvaultUser_ReadIsAdminByCipherIdUserId]",
new { UserId = userId, CipherId = cipherId },
commandType: CommandType.StoredProcedure);
return result;
}
}
}
}