File tree Expand file tree Collapse file tree 8 files changed +67
-1
lines changed
AbpCompanyName.AbpProjectName.Core/Localization/SourceFiles
AbpCompanyName.AbpProjectName.Web.Mvc
wwwroot/view-resources/Views/Account Expand file tree Collapse file tree 8 files changed +67
-1
lines changed Original file line number Diff line number Diff line change 117117 <text name =" ResetPasswordStepOneInfo" >1. Yönetici şifresini girin</text >
118118 <text name =" ResetPasswordStepTwoInfo" >2. Bu şifreyi kaydettikten sonra ilgili kullanıcıya gönderin</text >
119119 <text name =" UsersActivation" >Kullanıcıları aktifleştirme</text >
120+ <text name =" 403PageHeader" >Yetkisiz Erişim</text >
121+ <text name =" 403PageDescription" >Bu sayfaya erişmek için yetkiniz yok. Lütfen yöneticinizle iletişime geçin.</text >
122+ <text name =" 403PageButton" >Dashboard'a dön</text >
120123 </texts >
121124</localizationDictionary >
Original file line number Diff line number Diff line change 117117 <text name =" ResetPasswordStepOneInfo" >1. Enter your administrator password</text >
118118 <text name =" ResetPasswordStepTwoInfo" >2. Copy this random password so you can send it to the user</text >
119119 <text name =" UsersActivation" >Users activation</text >
120+ <text name =" 403PageHeader" >Forbidden</text >
121+ <text name =" 403PageDescription" >You don't have permission to access this resource. Please contact your administrator.</text >
122+ <text name =" 403PageButton" >Go back to Dashboard</text >
120123 </texts >
121124</localizationDictionary >
Original file line number Diff line number Diff line change @@ -367,6 +367,16 @@ protected virtual async Task<List<Tenant>> FindPossibleTenantsOfUserAsync(UserLo
367367
368368 #endregion
369369
370+ #region 403 Forbidden
371+
372+ [ Route ( "/Account/Forbidden" ) ]
373+ public ActionResult Error403 ( )
374+ {
375+ return View ( ) ;
376+ }
377+
378+ #endregion
379+
370380 #region Helpers
371381
372382 public ActionResult RedirectToAppHome ( )
Original file line number Diff line number Diff line change 11using System ;
22using System . Text ;
3+ using Abp . AspNetCore . Mvc . Authorization ;
4+ using Microsoft . AspNetCore . Mvc ;
35using Microsoft . Extensions . Configuration ;
46using Microsoft . Extensions . DependencyInjection ;
57using Microsoft . IdentityModel . Tokens ;
@@ -10,6 +12,11 @@ public static class AuthConfigurer
1012 {
1113 public static void Configure ( IServiceCollection services , IConfiguration configuration )
1214 {
15+ services . ConfigureApplicationCookie ( options =>
16+ {
17+ options . AccessDeniedPath = "/Account/Forbidden" ;
18+ } ) ;
19+
1320 if ( bool . Parse ( configuration [ "Authentication:JwtBearer:IsEnabled" ] ) )
1421 {
1522 services . AddAuthentication ( )
Original file line number Diff line number Diff line change 1+ @{
2+ ViewBag .Title = L (" 403PageHeader" );
3+ ViewBag .HideTenantChange = true ;
4+ }
5+
6+ @section styles
7+ {
8+ <link href =" ~/view-resources/Views/Account/Error403.css" rel =" stylesheet" asp-append-version =" true" />
9+ }
10+
11+ <div class =" forbidden-box d-flex flex-column align-items-center justify-content-center text-center" >
12+ <div class =" d-flex align-items-center" >
13+ <div class =" display-1 text-warning me-3" >
14+ 403
15+ </div >
16+ </div >
17+ <h2 class =" text-warning" >
18+ <i class =" fas fa-exclamation-triangle" ></i > @L( "403PageHeader")
19+ </h2 >
20+ <div class =" mt-4" >
21+ <p class =" lead text-muted" >
22+ @L( "403PageDescription")
23+ </p >
24+ <a href =" @Url.Action(" Index " , " Home " )" class =" btn btn-primary" >@L( "403PageButton")</a >
25+ </div >
26+ </div >
Original file line number Diff line number Diff line change 1212
1313 var pageTitle = ! string .IsNullOrWhiteSpace (ViewBag .Title ) ? ViewBag .Title + " / " : " " ;
1414 pageTitle += " AbpProjectName" ;
15+
16+ var hideTenantChange = ViewBag .HideTenantChange != null && ViewBag .HideTenantChange == true ;
17+ var showTenantChange = MultiTenancyConfig .IsEnabled && ! hideTenantChange ;
1518}
1619<!DOCTYPE html>
1720<html lang =" @LanguageManager.CurrentLanguage.Name" >
3134 <a href =" /" ><b >AbpProjectName</b ></a >
3235 </div >
3336 <div class =" card" >
34- @if (MultiTenancyConfig . IsEnabled )
37+ @if (showTenantChange )
3538 {
3639 <div class =" card-header" >
3740 <vc:tenant-change ></vc:tenant-change >
Original file line number Diff line number Diff line change 1+ .login-box {
2+ width : inherit;
3+ }
4+
5+ .forbidden-box {
6+ max-width : 350px ;
7+ }
Original file line number Diff line number Diff line change 1+ .login-box {
2+ width : inherit ;
3+ }
4+
5+ .forbidden-box {
6+ max-width : 350px ;
7+ }
You can’t perform that action at this time.
0 commit comments