@@ -64,24 +64,35 @@ public static IEndpointConventionBuilder MapHangfireDashboard(
6464 return endpoints . Map ( pattern + "/{**path}" , pipeline ) ;
6565 }
6666
67- public static IEndpointConventionBuilder MapHangfireDashboardWithAuthorizationPolicy (
67+ public static IEndpointConventionBuilder MapHangfireDashboardWithNoAuthorizationFilters (
6868 [ NotNull ] this IEndpointRouteBuilder endpoints ,
69- [ NotNull ] string authorizationPolicyName ,
7069 [ NotNull ] string pattern = "/hangfire" ,
7170 [ CanBeNull ] DashboardOptions options = null ,
7271 [ CanBeNull ] JobStorage storage = null )
7372 {
7473 if ( endpoints == null ) throw new ArgumentNullException ( nameof ( endpoints ) ) ;
75- if ( authorizationPolicyName == null ) throw new ArgumentNullException ( nameof ( authorizationPolicyName ) ) ;
7674
7775 options = options ?? new DashboardOptions ( ) ;
7876
7977 // We don't require the default LocalRequestsOnlyAuthorizationFilter since we provide our own policy
8078 options . Authorization = Enumerable . Empty < IDashboardAuthorizationFilter > ( ) ;
8179 options . AsyncAuthorization = Enumerable . Empty < IDashboardAsyncAuthorizationFilter > ( ) ;
8280
81+ return endpoints . MapHangfireDashboard ( pattern , options , storage ) ;
82+ }
83+
84+ public static IEndpointConventionBuilder MapHangfireDashboardWithAuthorizationPolicy (
85+ [ NotNull ] this IEndpointRouteBuilder endpoints ,
86+ [ NotNull ] string authorizationPolicyName ,
87+ [ NotNull ] string pattern = "/hangfire" ,
88+ [ CanBeNull ] DashboardOptions options = null ,
89+ [ CanBeNull ] JobStorage storage = null )
90+ {
91+ if ( endpoints == null ) throw new ArgumentNullException ( nameof ( endpoints ) ) ;
92+ if ( authorizationPolicyName == null ) throw new ArgumentNullException ( nameof ( authorizationPolicyName ) ) ;
93+
8394 return endpoints
84- . MapHangfireDashboard ( pattern , options , storage )
95+ . MapHangfireDashboardWithNoAuthorizationFilters ( pattern , options , storage )
8596 . RequireAuthorization ( authorizationPolicyName ) ;
8697 }
8798 }
0 commit comments