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 117
117
<text name =" ResetPasswordStepOneInfo" >1. Yönetici şifresini girin</text >
118
118
<text name =" ResetPasswordStepTwoInfo" >2. Bu şifreyi kaydettikten sonra ilgili kullanıcıya gönderin</text >
119
119
<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 >
120
123
</texts >
121
124
</localizationDictionary >
Original file line number Diff line number Diff line change 117
117
<text name =" ResetPasswordStepOneInfo" >1. Enter your administrator password</text >
118
118
<text name =" ResetPasswordStepTwoInfo" >2. Copy this random password so you can send it to the user</text >
119
119
<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 >
120
123
</texts >
121
124
</localizationDictionary >
Original file line number Diff line number Diff line change @@ -367,6 +367,16 @@ protected virtual async Task<List<Tenant>> FindPossibleTenantsOfUserAsync(UserLo
367
367
368
368
#endregion
369
369
370
+ #region 403 Forbidden
371
+
372
+ [ Route ( "/Account/Forbidden" ) ]
373
+ public ActionResult Error403 ( )
374
+ {
375
+ return View ( ) ;
376
+ }
377
+
378
+ #endregion
379
+
370
380
#region Helpers
371
381
372
382
public ActionResult RedirectToAppHome ( )
Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . Text ;
3
+ using Abp . AspNetCore . Mvc . Authorization ;
4
+ using Microsoft . AspNetCore . Mvc ;
3
5
using Microsoft . Extensions . Configuration ;
4
6
using Microsoft . Extensions . DependencyInjection ;
5
7
using Microsoft . IdentityModel . Tokens ;
@@ -10,6 +12,11 @@ public static class AuthConfigurer
10
12
{
11
13
public static void Configure ( IServiceCollection services , IConfiguration configuration )
12
14
{
15
+ services . ConfigureApplicationCookie ( options =>
16
+ {
17
+ options . AccessDeniedPath = "/Account/Forbidden" ;
18
+ } ) ;
19
+
13
20
if ( bool . Parse ( configuration [ "Authentication:JwtBearer:IsEnabled" ] ) )
14
21
{
15
22
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 12
12
13
13
var pageTitle = ! string .IsNullOrWhiteSpace (ViewBag .Title ) ? ViewBag .Title + " / " : " " ;
14
14
pageTitle += " AbpProjectName" ;
15
+
16
+ var hideTenantChange = ViewBag .HideTenantChange != null && ViewBag .HideTenantChange == true ;
17
+ var showTenantChange = MultiTenancyConfig .IsEnabled && ! hideTenantChange ;
15
18
}
16
19
<!DOCTYPE html>
17
20
<html lang =" @LanguageManager.CurrentLanguage.Name" >
31
34
<a href =" /" ><b >AbpProjectName</b ></a >
32
35
</div >
33
36
<div class =" card" >
34
- @if (MultiTenancyConfig . IsEnabled )
37
+ @if (showTenantChange )
35
38
{
36
39
<div class =" card-header" >
37
40
<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