Scope permissions by SiteId to support entity level authorization as well as improve caching and performance. Optimize GetTenant to use existing cache.

This commit is contained in:
Shaun Walker
2022-11-07 18:16:32 -05:00
parent 2aa6eb90e2
commit 6182b96d16
19 changed files with 103 additions and 115 deletions

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.EntityFrameworkCore;
@ -53,7 +53,7 @@ namespace Oqtane.Repository
public Tenant GetTenant(int tenantId)
{
return _db.Tenant.Find(tenantId);
return GetTenants().FirstOrDefault(item => item.TenantId == tenantId);
}
public void DeleteTenant(int tenantId)