using Hangfire.Dashboard;
namespace Dpz.Core.Web.Library;
public class HangfireFilter : IDashboardAuthorizationFilter
{
public bool Authorize(DashboardContext context)
{
var httpContext = context.GetHttpContext();
if (httpContext == null)
{
return false;
}
if (!httpContext.User.Authenticated)
{
return false;
}
return httpContext.User.HasSystem;
}
}
评论加载中...