#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Filters.TypeFilters;
using Lumina.Presentation.Web.Common.Models.Authorization;
#endregion
namespace Lumina.Presentation.Web.Common.Attributes;
///
/// Attribute that restricts endpoint access to users with specified roles.
///
///
/// Can be applied to controllers or individual actions. Multiple roles create an OR condition.
///
public class RequireRoleAttribute : ApiAuthorizationAttribute
{
///
/// Initializes a new instance of the class.
///
/// One or more roles that are allowed to access the endpoint.
public RequireRoleAttribute(params string[] roles) : base()
{
Arguments = [new AuthorizationRequirementModel { Roles = roles }];
}
}