forked from xiongyuxing/tiku-backend.net
feat(security): add distributed authorization foundation
This commit is contained in:
@@ -50,8 +50,9 @@ public sealed class QuestionBankQueryService(
|
||||
var platformItems = filter.Source == QuestionSource.Tenant || !await CanAccessPlatformAsync(filter.TenantId, cancellationToken)
|
||||
? []
|
||||
: await tenantExecutionScope.ExecuteAsync(
|
||||
filter.TenantId,
|
||||
"List platform question banks for an entitled tenant",
|
||||
new SystemScopeRequest(
|
||||
filter.TenantId, SystemScopeCallerType.PublicQuestionBank, nameof(QuestionBankQueryService),
|
||||
"List platform question banks for an entitled tenant", Guid.NewGuid().ToString("N")),
|
||||
async (provider, token) =>
|
||||
{
|
||||
var systemDbContext = provider.GetRequiredService<TikuDbContext>();
|
||||
@@ -336,8 +337,9 @@ public sealed class QuestionBankQueryService(
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
return tenantExecutionScope.ExecuteAsync(
|
||||
filter.TenantId,
|
||||
"List platform questions for an entitled tenant",
|
||||
new SystemScopeRequest(
|
||||
filter.TenantId, SystemScopeCallerType.PublicQuestionBank, nameof(QuestionBankQueryService),
|
||||
"List platform questions for an entitled tenant", Guid.NewGuid().ToString("N")),
|
||||
async (provider, token) =>
|
||||
{
|
||||
var systemDbContext = provider.GetRequiredService<TikuDbContext>();
|
||||
@@ -380,8 +382,9 @@ public sealed class QuestionBankQueryService(
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
return tenantExecutionScope.ExecuteAsync(
|
||||
tenantId,
|
||||
"Read platform question versions for an entitled tenant",
|
||||
new SystemScopeRequest(
|
||||
tenantId, SystemScopeCallerType.PublicQuestionBank, nameof(QuestionBankQueryService),
|
||||
"Read platform question versions for an entitled tenant", Guid.NewGuid().ToString("N")),
|
||||
async (provider, token) =>
|
||||
{
|
||||
var systemDbContext = provider.GetRequiredService<TikuDbContext>();
|
||||
|
||||
Reference in New Issue
Block a user