- 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.
28 lines
1.4 KiB
C#
28 lines
1.4 KiB
C#
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) { }
|
||
}
|