using Microsoft.AspNetCore.Authorization;

namespace TakeoutSaaS.Module.Authorization.Policies;

/// <summary>
/// 权限要求：用于授权策略中定义所需的权限集合。
/// </summary>
public sealed class PermissionRequirement(IReadOnlyCollection<string> permissions) : IAuthorizationRequirement
{
    /// <summary>
    /// 所需的权限集合。
    /// </summary>
    public IReadOnlyCollection<string> Permissions { get; } = permissions ?? throw new ArgumentNullException(nameof(permissions));
}
