Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Access denied page to Account module. #7215

Merged
merged 1 commit into from
Jan 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
"Volo.Account:InvalidEmailAddress": "找不到给定的电子邮件地址:{0}",
"PasswordReset": "重设密码",
"PasswordResetInfoInEmail": "我们收到了帐户恢复请求!如果你发起了此请求,请单击以下链接以重置密码.",
"ResetMyPassword": "重置我的密码"
"ResetMyPassword": "重置我的密码",
"AccessDenied": "拒绝访问!",
"AccessDeniedMessage": "你无权访问此资源."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
"ReturnToApplication": "返回到應用程序",
"PasswordReset": "重設密碼",
"PasswordResetInfoInEmail": "我們收到了帳戶恢復請求!如果你發起了此請求,請單擊以下鏈接以重置密碼.",
"ResetMyPassword": "重置我的密碼"
"ResetMyPassword": "重置我的密碼",
"AccessDenied": "拒絕訪問!",
"AccessDeniedMessage": "您無權訪問此資源."
}
}
Original file line number Diff line number Diff line change
@@ -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<AccountResource> L

<div class="card mt-3 shadow-sm rounded">
<div class="card-body p-5">
<h4>@L["AccessDenied"]</h4>
<form method="post" class="mt-4">
<p>@L["AccessDeniedMessage"]</p>
<a abp-button="Primary" asp-page="./Login" asp-all-route-data="@(new Dictionary<string, string> {{"returnUrl", Model.ReturnUrl}, {"returnUrlHash", Model.ReturnUrlHash}})">&larr; @L["BackToLogin"]</a>
</form>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -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<IActionResult> OnGetAsync()
{
return Task.FromResult<IActionResult>(Page());
}

public virtual Task<IActionResult> OnPostAsync()
{
return Task.FromResult<IActionResult>(Page());
}
}
}