File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
Example3.MvcWebApp.IndividualAccounts Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 44using System . Diagnostics ;
55using System . Threading . Tasks ;
66using AuthPermissions . SupportCode . AddUsersServices ;
7- using Example3 . InvoiceCode . Services ;
87using Example3 . MvcWebApp . IndividualAccounts . PermissionsCode ;
98using Microsoft . AspNetCore . Authorization ;
9+ using System . Linq ;
10+ using AuthPermissions . BaseCode . PermissionsCode ;
1011
1112namespace Example3 . MvcWebApp . IndividualAccounts . Controllers
1213{
@@ -23,7 +24,7 @@ public IActionResult Index(string message)
2324 {
2425 ViewBag . Message = message ;
2526
26- if ( AddTenantNameClaim . GetTenantNameFromUser ( User ) == null )
27+ if ( User . Claims . All ( x => x . Type != PermissionConstants . DataKeyClaimType ) )
2728 return View ( new AppSummary ( ) ) ;
2829
2930 return RedirectToAction ( "Index" , "Invoice" ) ;
Original file line number Diff line number Diff line change 5252 //NOTE: This uses the same database as the individual accounts DB
5353 . UsingEfCoreSqlServer ( connectionString )
5454 . IndividualAccountsAuthentication ( )
55- . RegisterAddClaimToUser < AddTenantNameClaim > ( )
5655 . RegisterAddClaimToUser < AddRefreshEveryMinuteClaim > ( )
5756 . RegisterTenantChangeService < InvoiceTenantChangeService > ( )
5857 . AddRolesPermissionsIfEmpty ( Example3AppAuthSetupData . RolesDefinition )
Original file line number Diff line number Diff line change 88<head >
99 <meta charset =" utf-8" />
1010 <meta name =" viewport" content =" width=device-width, initial-scale=1.0" />
11- <title >@ViewData ["Title"] - @AddTenantNameClaim.GetTenantNameFromUser(User) </title >
11+ @* <title>@ViewData["Title"] - @AddTenantNameClaim.GetTenantNameFromUser(User)</title> *@
1212 <link rel =" stylesheet" href =" ~/lib/bootstrap/dist/css/bootstrap.min.css" />
1313 <link rel =" stylesheet" href =" ~/css/site.css" />
1414</head >
You can’t perform that action at this time.
0 commit comments