From bb2c098cb9dcf98258d039daa5cc4adc9e3d6ca7 Mon Sep 17 00:00:00 2001 From: "ashutosh.nehete" Date: Fri, 10 Oct 2025 14:17:32 +0530 Subject: [PATCH] Sloved issues of permissions not been assigned when updating the subscription --- Marco.Pms.Services/Controllers/TenantController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marco.Pms.Services/Controllers/TenantController.cs b/Marco.Pms.Services/Controllers/TenantController.cs index 0c11daf..d20a049 100644 --- a/Marco.Pms.Services/Controllers/TenantController.cs +++ b/Marco.Pms.Services/Controllers/TenantController.cs @@ -1069,7 +1069,7 @@ namespace Marco.Pms.Services.Controllers // Get root employee and role for this tenant var rootEmployee = await _context.Employees .Include(e => e.ApplicationUser) - .FirstOrDefaultAsync(e => e.ApplicationUser != null && (e.ApplicationUser.IsRootUser ?? false) && e.TenantId == model.TenantId); + .FirstOrDefaultAsync(e => e.ApplicationUser != null && (e.ApplicationUser.IsRootUser ?? false) && e.OrganizationId == tenant.OrganizationId); if (rootEmployee == null) { @@ -1363,7 +1363,7 @@ namespace Marco.Pms.Services.Controllers // 8c. Find root employee & role for this tenant. var rootEmployee = await context.Employees .Include(e => e.ApplicationUser) - .FirstOrDefaultAsync(e => e.ApplicationUser != null && (e.ApplicationUser.IsRootUser ?? false) && e.TenantId == model.TenantId); + .FirstOrDefaultAsync(e => e.ApplicationUser != null && (e.ApplicationUser.IsRootUser ?? false) && e.OrganizationId == tenant.OrganizationId); if (rootEmployee == null) { -- 2.43.0