15 lines
363 B
C#
15 lines
363 B
C#
|
|
using System.Security.Claims;
|
||
|
|
using isnd.Data;
|
||
|
|
|
||
|
|
namespace isnd.Helpers
|
||
|
|
{
|
||
|
|
public static class PackageVersionHelpers
|
||
|
|
{
|
||
|
|
|
||
|
|
public static bool IsOwner(this ClaimsPrincipal user, PackageVersion v)
|
||
|
|
{
|
||
|
|
var userId = user.FindFirstValue(ClaimTypes.NameIdentifier);
|
||
|
|
return v.Package.OwnerId == userId;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|