222 lines
6.3 KiB
C#
222 lines
6.3 KiB
C#
using System.Security.Claims;
|
|
|
|
namespace NetinaShop.Domain.Models.Claims;
|
|
|
|
public static class ApplicationClaims
|
|
{
|
|
|
|
public static ClaimDto ManageBlogs { get; } = new ClaimDto
|
|
{
|
|
Type = CustomClaimType.Permission,
|
|
Value = ApplicationPermission.ManageBlogs,
|
|
};
|
|
public static ClaimDto ViewBlogs { get; } = new ClaimDto
|
|
{
|
|
Type = CustomClaimType.Permission,
|
|
Value = ApplicationPermission.ViewBlogs,
|
|
};
|
|
|
|
public static ClaimDto ManageBrands { get; } = new ClaimDto
|
|
{
|
|
Type = CustomClaimType.Permission,
|
|
Value = ApplicationPermission.ManageBrands,
|
|
};
|
|
public static ClaimDto ViewBrands { get; } = new ClaimDto
|
|
{
|
|
Type = CustomClaimType.Permission,
|
|
Value = ApplicationPermission.ViewBrands,
|
|
};
|
|
|
|
public static ClaimDto ManageCategories { get; } = new ClaimDto
|
|
{
|
|
Type = CustomClaimType.Permission,
|
|
Value = ApplicationPermission.ManageCategories,
|
|
};
|
|
public static ClaimDto ViewCategories { get; } = new ClaimDto
|
|
{
|
|
Type = CustomClaimType.Permission,
|
|
Value = ApplicationPermission.ViewCategories,
|
|
};
|
|
|
|
public static ClaimDto ManageDiscounts { get; } = new ClaimDto
|
|
{
|
|
Type = CustomClaimType.Permission,
|
|
Value = ApplicationPermission.ManageDiscounts,
|
|
};
|
|
public static ClaimDto ViewDiscounts { get; } = new ClaimDto
|
|
{
|
|
Type = CustomClaimType.Permission,
|
|
Value = ApplicationPermission.ViewDiscounts,
|
|
};
|
|
|
|
public static ClaimDto ManageOrders { get; } = new ClaimDto
|
|
{
|
|
Type = CustomClaimType.Permission,
|
|
Value = ApplicationPermission.ManageOrders,
|
|
};
|
|
public static ClaimDto ViewAllOrders { get; } = new ClaimDto
|
|
{
|
|
Type = CustomClaimType.Permission,
|
|
Value = ApplicationPermission.ViewAllOrders,
|
|
};
|
|
public static ClaimDto ViewMineOrders { get; } = new ClaimDto
|
|
{
|
|
Type = CustomClaimType.Permission,
|
|
Value = ApplicationPermission.ViewMineOrders,
|
|
};
|
|
public static ClaimDto CreateOrder { get; } = new ClaimDto
|
|
{
|
|
Type = CustomClaimType.Permission,
|
|
Value = ApplicationPermission.CreateOrder,
|
|
};
|
|
|
|
public static ClaimDto ManageProducts { get; } = new ClaimDto
|
|
{
|
|
Type = CustomClaimType.Permission,
|
|
Value = ApplicationPermission.ManageProducts,
|
|
};
|
|
public static ClaimDto ViewProducts { get; } = new ClaimDto
|
|
{
|
|
Type = CustomClaimType.Permission,
|
|
Value = ApplicationPermission.ViewProducts,
|
|
};
|
|
|
|
public static ClaimDto ManageReview { get; } = new ClaimDto
|
|
{
|
|
Type = CustomClaimType.Permission,
|
|
Value = ApplicationPermission.ManageReview,
|
|
};
|
|
public static ClaimDto ViewAllReviews { get; } = new ClaimDto
|
|
{
|
|
Type = CustomClaimType.Permission,
|
|
Value = ApplicationPermission.ViewAllReviews,
|
|
};
|
|
public static ClaimDto ViewMineReviews { get; } = new ClaimDto
|
|
{
|
|
Type = CustomClaimType.Permission,
|
|
Value = ApplicationPermission.ViewMineReviews,
|
|
};
|
|
public static ClaimDto AddReview { get; } = new ClaimDto
|
|
{
|
|
Type = CustomClaimType.Permission,
|
|
Value = ApplicationPermission.AddReview,
|
|
};
|
|
|
|
public static ClaimDto ViewWarehouses { get; } = new ClaimDto
|
|
{
|
|
Type = CustomClaimType.Permission,
|
|
Value = ApplicationPermission.ViewWarehouses,
|
|
};
|
|
public static ClaimDto ManageWarehouses { get; } = new ClaimDto
|
|
{
|
|
Type = CustomClaimType.Permission,
|
|
Value = ApplicationPermission.ManageWarehouses,
|
|
};
|
|
|
|
public static ClaimDto ViewShipping { get; } = new ClaimDto
|
|
{
|
|
Type = CustomClaimType.Permission,
|
|
Value = ApplicationPermission.ViewShipping,
|
|
};
|
|
public static ClaimDto ManageShipping { get; } = new ClaimDto
|
|
{
|
|
Type = CustomClaimType.Permission,
|
|
Value = ApplicationPermission.ManageShipping,
|
|
};
|
|
|
|
public static ClaimDto ManageUsers { get; } = new ClaimDto
|
|
{
|
|
Type = CustomClaimType.Permission,
|
|
Value = ApplicationPermission.ManageUsers,
|
|
};
|
|
public static ClaimDto ViewUsers { get; } = new ClaimDto
|
|
{
|
|
Type = CustomClaimType.Permission,
|
|
Value = ApplicationPermission.ViewUsers,
|
|
};
|
|
|
|
public static ClaimDto ManageFiles { get; } = new ClaimDto
|
|
{
|
|
Type = CustomClaimType.Permission,
|
|
Value = ApplicationPermission.ManageFiles,
|
|
};
|
|
public static ClaimDto ViewFiles { get; } = new ClaimDto
|
|
{
|
|
Type = CustomClaimType.Permission,
|
|
Value = ApplicationPermission.ViewFiles,
|
|
};
|
|
|
|
public static List<ClaimDto> AllClaimDtos = new List<ClaimDto>
|
|
{
|
|
ManageBlogs,
|
|
ViewBlogs,
|
|
ManageBrands,
|
|
ViewBrands,
|
|
ManageCategories,
|
|
ViewCategories,
|
|
ManageDiscounts,
|
|
ViewDiscounts,
|
|
ManageOrders,
|
|
ViewAllOrders,
|
|
ViewMineOrders,
|
|
CreateOrder,
|
|
ManageProducts,
|
|
ViewProducts,
|
|
ManageReview,
|
|
AddReview,
|
|
ViewAllReviews,
|
|
ViewMineReviews,
|
|
ManageWarehouses,
|
|
ViewWarehouses,
|
|
ManageShipping,
|
|
ViewShipping,
|
|
ManageUsers,
|
|
ViewUsers,
|
|
ManageFiles,
|
|
ViewFiles
|
|
};
|
|
|
|
public static List<Claim> AllClaims = new List<Claim>
|
|
{
|
|
ManageBlogs.GetClaim,
|
|
ViewBlogs.GetClaim,
|
|
ManageBrands.GetClaim,
|
|
ViewBrands.GetClaim,
|
|
ManageCategories.GetClaim,
|
|
ViewCategories.GetClaim,
|
|
ManageDiscounts.GetClaim,
|
|
ViewDiscounts.GetClaim,
|
|
ManageOrders.GetClaim,
|
|
ViewAllOrders.GetClaim,
|
|
ViewMineOrders.GetClaim,
|
|
CreateOrder.GetClaim,
|
|
ManageProducts.GetClaim,
|
|
ViewProducts.GetClaim,
|
|
ManageReview.GetClaim,
|
|
AddReview.GetClaim,
|
|
ViewAllReviews.GetClaim,
|
|
ViewMineReviews.GetClaim,
|
|
ManageWarehouses.GetClaim,
|
|
ViewWarehouses.GetClaim,
|
|
ManageShipping.GetClaim,
|
|
ViewShipping.GetClaim,
|
|
ManageUsers.GetClaim,
|
|
ViewUsers.GetClaim,
|
|
ManageFiles.GetClaim,
|
|
ViewFiles.GetClaim
|
|
};
|
|
|
|
public static List<Claim> CustomerClaims = new List<Claim>
|
|
{
|
|
ViewBlogs.GetClaim,
|
|
ViewBrands.GetClaim,
|
|
ViewCategories.GetClaim,
|
|
ViewMineOrders.GetClaim,
|
|
CreateOrder.GetClaim,
|
|
ViewProducts.GetClaim,
|
|
AddReview.GetClaim,
|
|
ViewMineReviews.GetClaim,
|
|
};
|
|
|
|
}
|