Browse Source

Merge pull request #10097 from abpframework/auto-merge/rel-4-4/552

Merge branch dev with rel-4.4
pull/10100/head
Engincan VESKE 5 years ago
committed by GitHub
parent
commit
d2c2d70a06
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 22
      docs/en/Background-Jobs-Hangfire.md

22
docs/en/Background-Jobs-Hangfire.md

@ -88,17 +88,21 @@ To make it secure by default, only local requests are allowed, however you can c
You can integrate the Hangfire dashboard to [ABP authorization system](Authorization.md) using the **AbpHangfireAuthorizationFilter** You can integrate the Hangfire dashboard to [ABP authorization system](Authorization.md) using the **AbpHangfireAuthorizationFilter**
class. This class is defined in the `Volo.Abp.Hangfire` package. The following example, checks if the current user is logged in to the application: class. This class is defined in the `Volo.Abp.Hangfire` package. The following example, checks if the current user is logged in to the application:
app.UseHangfireDashboard("/hangfire", new DashboardOptions ```csharp
{ app.UseHangfireDashboard("/hangfire", new DashboardOptions
AsyncAuthorization = new[] { new AbpHangfireAuthorizationFilter() } {
}); AsyncAuthorization = new[] { new AbpHangfireAuthorizationFilter() }
});
```
If you want to require an additional permission, you can pass it into the constructor as below: If you want to require an additional permission, you can pass it into the constructor as below:
app.UseHangfireDashboard("/hangfire", new DashboardOptions ```csharp
{ app.UseHangfireDashboard("/hangfire", new DashboardOptions
AsyncAuthorization = new[] { new AbpHangfireAuthorizationFilter("MyHangFireDashboardPermissionName") } {
}); AsyncAuthorization = new[] { new AbpHangfireAuthorizationFilter("MyHangFireDashboardPermissionName") }
});
```
**Important**: `UseHangfireDashboard` should be called after the authentication middleware in your `Startup` class (probably at the last line). Otherwise, **Important**: `UseHangfireDashboard` should be called after the authentication and authorization middlewares in your `Startup` class (probably at the last line). Otherwise,
authorization will always fail! authorization will always fail!

Loading…
Cancel
Save