From 848aa2ecfac51d4deef47377733bc3bc4e87abed Mon Sep 17 00:00:00 2001 From: maliming Date: Fri, 18 Jun 2021 14:52:14 +0800 Subject: [PATCH] Add CheckCurrentTenant. --- .../Pages/Account/AccountPageModel.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/AccountPageModel.cs b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/AccountPageModel.cs index 8e12f4648a..32f2398629 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/AccountPageModel.cs +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/AccountPageModel.cs @@ -71,6 +71,14 @@ namespace Volo.Abp.Account.Web.Pages.Account return false; } + protected virtual void CheckCurrentTenant(Guid? tenantId) + { + if (CurrentTenant.Id != tenantId) + { + throw new ApplicationException($"Current tenant is different than given tenant. CurrentTenant.Id: {CurrentTenant.Id}, given tenantId: {tenantId}"); + } + } + protected virtual void CheckIdentityErrors(IdentityResult identityResult) { if (!identityResult.Succeeded)