1
0
mirror of https://github.com/bitwarden/server synced 2025-12-27 05:33:17 +00:00

share api

This commit is contained in:
Kyle Spearrin
2017-02-21 23:18:12 -05:00
parent 900e71d4dd
commit 0caea4ab8b
9 changed files with 160 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
using System;
using Bit.Core.Domains;
using System.Threading.Tasks;
namespace Bit.Core.Repositories.SqlServer
{
@@ -12,5 +13,16 @@ namespace Bit.Core.Repositories.SqlServer
public ShareRepository(string connectionString)
: base(connectionString)
{ }
public async Task<Share> GetByIdAsync(Guid id, Guid userId)
{
var share = await GetByIdAsync(id);
if(share == null || (share.UserId != userId && share.SharerUserId != userId))
{
return null;
}
return share;
}
}
}