using Microsoft.AspNetCore.Authorization;
using MilitaryTrainingManagement.Models.Enums;

namespace MilitaryTrainingManagement.Authorization;

/// <summary>
/// 组织层级授权需求 - 要求用户具有指定层级或更高层级的权限
/// </summary>
public class OrganizationalLevelRequirement : IAuthorizationRequirement
{
    public OrganizationalLevel MinimumLevel { get; }

    public OrganizationalLevelRequirement(OrganizationalLevel minimumLevel)
    {
        MinimumLevel = minimumLevel;
    }
}

/// <summary>
/// 组织层级资源访问需求 - 用于验证用户是否可以访问特定组织单位的资源
/// </summary>
public class OrganizationalResourceRequirement : IAuthorizationRequirement
{
    public static OrganizationalResourceRequirement Instance { get; } = new();
}
