diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json index 755cd5674b2..459d1153980 100644 --- a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json +++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json @@ -60,6 +60,8 @@ "Volo.Account:InvalidEmailAddress": "Can not find the given email address: {0}", "PasswordReset": "Password reset", "PasswordResetInfoInEmail": "We received an account recovery request! If you initiated this request, click the following link to reset your password.", - "ResetMyPassword": "Reset my password" + "ResetMyPassword": "Reset my password", + "AccessDenied": "Access denied!", + "AccessDeniedMessage": "You do not have access to this resource." } } diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/tr.json b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/tr.json index d8cf5dd74fd..a1c899357b9 100644 --- a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/tr.json +++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/tr.json @@ -60,6 +60,8 @@ "Volo.Account:InvalidEmailAddress": "Email adresi bulunamadı: {0}", "PasswordReset": "Şifre Sıfırlama", "PasswordResetInfoInEmail": "Şifrenizi sıfırlamanız için bir talep aldık! Eğer bu talebi siz gerçekleştirmişseniz, şifrenizi sıfırlamak için bağlantıya tıklayın.", - "ResetMyPassword": "Şifremi sıfırla" + "ResetMyPassword": "Şifremi sıfırla", + "AccessDenied": "Erişim reddedildi!", + "AccessDeniedMessage": "Bu kaynağa erişiminiz yok." } } diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hans.json b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hans.json index 53fe6135f28..26c6fc3337a 100644 --- a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hans.json +++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hans.json @@ -60,6 +60,8 @@ "Volo.Account:InvalidEmailAddress": "找不到给定的电子邮件地址:{0}", "PasswordReset": "重设密码", "PasswordResetInfoInEmail": "我们收到了帐户恢复请求!如果你发起了此请求,请单击以下链接以重置密码.", - "ResetMyPassword": "重置我的密码" + "ResetMyPassword": "重置我的密码", + "AccessDenied": "拒绝访问!", + "AccessDeniedMessage": "你无权访问此资源." } } diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hant.json b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hant.json index a67ea8d63fa..8a574293444 100644 --- a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hant.json +++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hant.json @@ -58,6 +58,8 @@ "ReturnToApplication": "返回到應用程序", "PasswordReset": "重設密碼", "PasswordResetInfoInEmail": "我們收到了帳戶恢復請求!如果你發起了此請求,請單擊以下鏈接以重置密碼.", - "ResetMyPassword": "重置我的密碼" + "ResetMyPassword": "重置我的密碼", + "AccessDenied": "拒絕訪問!", + "AccessDeniedMessage": "您無權訪問此資源." } } diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/AccessDenied.cshtml b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/AccessDenied.cshtml new file mode 100644 index 00000000000..28608ff8837 --- /dev/null +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/AccessDenied.cshtml @@ -0,0 +1,15 @@ +@page +@model Volo.Abp.Account.Web.Pages.Account.AccessDeniedModel +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.Account.Localization +@inject IHtmlLocalizer L + +
+
+

@L["AccessDenied"]

+
+

@L["AccessDeniedMessage"]

+ ← @L["BackToLogin"] +
+
+
diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/AccessDenied.cshtml.cs b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/AccessDenied.cshtml.cs new file mode 100644 index 00000000000..7ac9639d0bc --- /dev/null +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/AccessDenied.cshtml.cs @@ -0,0 +1,24 @@ +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace Volo.Abp.Account.Web.Pages.Account +{ + public class AccessDeniedModel : AccountPageModel + { + [BindProperty(SupportsGet = true)] + public string ReturnUrl { get; set; } + + [BindProperty(SupportsGet = true)] + public string ReturnUrlHash { get; set; } + + public virtual Task OnGetAsync() + { + return Task.FromResult(Page()); + } + + public virtual Task OnPostAsync() + { + return Task.FromResult(Page()); + } + } +}