Changed the logic for super tenant
This commit is contained in:
parent
300f570907
commit
3864788d43
@ -549,10 +549,6 @@ namespace Marco.Pms.Services.Controllers
|
|||||||
using var scope = _serviceScopeFactory.CreateScope();
|
using var scope = _serviceScopeFactory.CreateScope();
|
||||||
var generalHelper = scope.ServiceProvider.GetRequiredService<GeneralHelper>();
|
var generalHelper = scope.ServiceProvider.GetRequiredService<GeneralHelper>();
|
||||||
|
|
||||||
// Fetch features enabled for tenant
|
|
||||||
var featureIds = await generalHelper.GetFeatureIdsByTenentIdAsync(tenantId);
|
|
||||||
_logger.LogInfo("Enabled features for TenantId: {TenantId} -> {FeatureIds}", tenantId, string.Join(",", featureIds));
|
|
||||||
|
|
||||||
// Define static master menus for each feature section
|
// Define static master menus for each feature section
|
||||||
var featureMenus = new Dictionary<Guid, List<MasterMenuVM>>
|
var featureMenus = new Dictionary<Guid, List<MasterMenuVM>>
|
||||||
{
|
{
|
||||||
@ -586,6 +582,17 @@ namespace Marco.Pms.Services.Controllers
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (tenantId == superTenantId)
|
||||||
|
{
|
||||||
|
_logger.LogInfo("MasterMenu count for TenantId {TenantId}: {Count}", tenantId, featureMenus.Count);
|
||||||
|
|
||||||
|
return Ok(ApiResponse<object>.SuccessResponse(featureMenus, "Successfully fetched the master table list", 200));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fetch features enabled for tenant
|
||||||
|
var featureIds = await generalHelper.GetFeatureIdsByTenentIdAsync(tenantId);
|
||||||
|
_logger.LogInfo("Enabled features for TenantId: {TenantId} -> {FeatureIds}", tenantId, string.Join(",", featureIds));
|
||||||
|
|
||||||
// Aggregate menus based on enabled features
|
// Aggregate menus based on enabled features
|
||||||
var response = featureIds
|
var response = featureIds
|
||||||
.Where(id => featureMenus.ContainsKey(id))
|
.Where(id => featureMenus.ContainsKey(id))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user