Files
PnvPanel/backend/src/PnvPanel.Infrastructure/Identity/AppRole.cs
T
Leonid Pershin fad03c2834
CI / Backend (build + test) (push) Failing after 1m23s
CI / Frontend (lint + typecheck + build) (push) Successful in 34s
Enhance user plan management and update related endpoints
- Added new configuration options for user plans in `.env.example`, including `Plans__MaxCustomConfigCount` and `Plans__MinCustomConfigCount`.
- Introduced `MapPlanEndpoints` in `Program.cs` to handle plan-related API routes.
- Implemented `SetUserPlan` endpoint in `RoleEndpoints` to allow admins to assign plans to users.
- Removed deprecated role request approval endpoints from `AdminSupportEndpoints`.
- Updated `ITelegramNotifier` and related classes to reflect changes in role request handling and payment notifications.
- Refactored role management commands to remove `MaxConfigs` and focus on `MaxIpLimit` and billing settings.
- Enhanced billing request handling to accommodate plan changes instead of role changes.
- Updated various interfaces and command handlers to support new plan management features.
2026-07-23 22:52:20 +03:00

28 lines
1.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using Microsoft.AspNetCore.Identity;
using PnvPanel.Application.Common.Models;
namespace PnvPanel.Infrastructure.Identity;
/// <summary>Роль с лимитом одновременных IP на клиента, доступом к инбаундам и флагом биллинга.
/// Квота конфигов больше не на роли — см. AppUser.ConfigQuota/Plan. У пользователя ровно одна роль.</summary>
public class AppRole : IdentityRole<Guid>
{
public const int UnlimitedMaxIpLimit = RoleQuota.Unlimited;
/// <summary>Лимит одновременных IP на клиента в 3x-ui (`limitIp`); -1 — без лимита. Применяется
/// только к новым клиентам, создаваемым в 3x-ui (см. IXuiPanelGateway.AddClientAsync) — при смене
/// роли/лимита существующие клиенты в панели не трогаются (как и квота ConfigQuota).</summary>
public int MaxIpLimit { get; set; }
public bool IsSystem { get; set; }
/// <summary>Включает биллинг для пользователей с этой ролью (недоступно для роли admin — см.
/// RoleService.UpdateRoleAsync).</summary>
public bool BillingEnabled { get; set; }
public AppRole() { }
public AppRole(string name)
: base(name) { }
}