isn/src/isnd/Helpers/PackageVersionHelpers.cs

20 lines
No EOL
482 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using isn.abst;
using isnd.Data;
using isnd.Data.Catalog;
using isnd.Entities;
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;
}
}
}