fix issue #170 which is related to the host user not being part of the Registered Users role
This commit is contained in:
21
Oqtane.Server/Infrastructure/TestJob.cs
Normal file
21
Oqtane.Server/Infrastructure/TestJob.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Oqtane.Models;
|
||||
using Oqtane.Repository;
|
||||
|
||||
namespace Oqtane.Infrastructure
|
||||
{
|
||||
public class TestJob : HostedServiceBase
|
||||
{
|
||||
public TestJob(IServiceScopeFactory ServiceScopeFactory) : base(ServiceScopeFactory) {}
|
||||
|
||||
public override void ExecuteJob(IServiceProvider provider)
|
||||
{
|
||||
var Tenants = provider.GetRequiredService<ITenantRepository>();
|
||||
foreach(Tenant tenant in Tenants.GetTenants())
|
||||
{
|
||||
// is it possible to set the HttpContext so that DbContextBase will resolve properly for tenants?
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user