2022-09-23 20:34:51 +01:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2021-09-05 15:44:47 +01:00
|
|
|
using System.Security.Claims;
|
2022-09-23 20:34:51 +01:00
|
|
|
using isn.abst;
|
2021-09-05 15:44:47 +01:00
|
|
|
using isnd.Data;
|
2022-09-23 20:34:51 +01:00
|
|
|
using isnd.Data.Catalog;
|
|
|
|
|
using isnd.Entities;
|
2021-09-05 15:44:47 +01:00
|
|
|
|
|
|
|
|
namespace isnd.Helpers
|
|
|
|
|
{
|
|
|
|
|
public static class PackageVersionHelpers
|
|
|
|
|
{
|
|
|
|
|
public static bool IsOwner(this ClaimsPrincipal user, PackageVersion v)
|
|
|
|
|
{
|
2022-09-23 20:34:51 +01:00
|
|
|
var userId = user.FindFirstValue(ClaimTypes.NameIdentifier);
|
2021-09-05 15:44:47 +01:00
|
|
|
return v.Package.OwnerId == userId;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|