File tree Expand file tree Collapse file tree 11 files changed +24
-51
lines changed
Expand file tree Collapse file tree 11 files changed +24
-51
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- @using GradeManagement .Client .Authorization .Policies
1+ @using GradeManagement .Shared .Authorization .Policies
22<MudNavMenu >
33 <MudNavLink Href =" /" Match =" NavLinkMatch.All" >Dashboard</MudNavLink >
4- <MudNavGroup Title =" Data" Expanded =" true" >
5- <MudNavLink Href =" /courses" Match =" NavLinkMatch.Prefix" >Courses</MudNavLink >
6- <MudNavLink Href =" /semesters" Match =" NavLinkMatch.Prefix" >Semesters</MudNavLink >
7- <MudNavLink Href =" /languages" Match =" NavLinkMatch.Prefix" >Languages</MudNavLink >
8- <MudNavLink Href =" /teachers" Match =" NavLinkMatch.Prefix" >Teachers</MudNavLink >
9- </MudNavGroup >
104 <AuthorizeView Policy =" @TeacherRequirement.PolicyName" >
115 <Authorized >
6+ <MudNavGroup Title =" Data" Expanded =" true" >
7+ <MudNavLink Href =" /courses" Match =" NavLinkMatch.Prefix" >Courses</MudNavLink >
8+ <MudNavLink Href =" /semesters" Match =" NavLinkMatch.Prefix" >Semesters</MudNavLink >
9+ <MudNavLink Href =" /languages" Match =" NavLinkMatch.Prefix" >Languages</MudNavLink >
10+ <MudNavLink Href =" /teachers" Match =" NavLinkMatch.Prefix" >Teachers</MudNavLink >
11+ </MudNavGroup >
1212 <MudNavGroup Title =" Admin" Expanded =" false" >
1313 <MudNavLink Href =" /subjects" Match =" NavLinkMatch.Prefix" >Subjects</MudNavLink >
1414 <MudNavLink Href =" /students" Match =" NavLinkMatch.Prefix" >Students</MudNavLink >
Original file line number Diff line number Diff line change 9595// }
9696
9797 #endregion
98-
98+ // Van e assignolt teacher?
99+ // Mikor pontoztak? Tooltip
100+ // PR status - closed szűrve
99101 private LoadingComponent loadingRef ;
100102
101103 private Subject ? _selectedSubject = null ;
Original file line number Diff line number Diff line change 11@page " /subjects"
2- @using GradeManagement .Client .Authorization .Policies
32@using GradeManagement .Client .Components .NewDialogs
3+ @using GradeManagement .Shared .Authorization .Policies
44@layout AuthenticatedLayout
55@inject IDialogService DialogService
66@inject CrudSnackbarService SnackbarService
Original file line number Diff line number Diff line change 1- using GradeManagement . Client . Authorization . Handlers ;
2- using GradeManagement . Client . Authorization . Policies ;
31using GradeManagement . Client . Network ;
42using GradeManagement . Client . Services ;
3+ using GradeManagement . Shared . Authorization . Handlers ;
4+ using GradeManagement . Shared . Authorization . Policies ;
55
66using Microsoft . AspNetCore . Authorization ;
77using Microsoft . AspNetCore . Components . Web ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11using GradeManagement . Bll ;
2- using GradeManagement . Server . Authorization . Policies ;
32using GradeManagement . Server . Controllers . BaseControllers ;
3+ using GradeManagement . Shared . Authorization . Policies ;
44using GradeManagement . Shared . Dtos ;
55using GradeManagement . Shared . Dtos . Request ;
66
Original file line number Diff line number Diff line change 11using GradeManagement . Data . Data ;
22using GradeManagement . Bll ;
3- using GradeManagement . Server . Authorization . Handlers ;
4- using GradeManagement . Server . Authorization . Policies ;
53using GradeManagement . Server . ExceptionHandlers ;
4+ using GradeManagement . Shared . Authorization . Handlers ;
5+ using GradeManagement . Shared . Authorization . Policies ;
66
77using Microsoft . EntityFrameworkCore ;
88using Microsoft . AspNetCore . Authorization ;
Original file line number Diff line number Diff line change 1- using GradeManagement . Server . Authorization . Policies ;
1+ using GradeManagement . Shared . Authorization . Policies ;
22
33using Microsoft . AspNetCore . Authorization ;
44
55using System . Security . Claims ;
66
7- namespace GradeManagement . Server . Authorization . Handlers ;
7+ namespace GradeManagement . Shared . Authorization . Handlers ;
88
99public class TeacherRequirementHandler : AuthorizationHandler < TeacherRequirement >
1010{
@@ -14,7 +14,7 @@ protected override Task HandleRequirementAsync(
1414 AuthorizationHandlerContext context , TeacherRequirement requirement )
1515 {
1616 //Here the email should be in Tenant or invited in by one meeting
17- var emailAddress = context . User . FindFirstValue ( ClaimTypes . Email ) ;
17+ var emailAddress = context . User . FindFirst ( ClaimTypes . Email ) ? . Value ?? context . User . FindFirst ( "email" ) ? . Value ;
1818 if ( emailAddress is not null && ( emailAddress . EndsWith ( "@vik.bme.hu" ) == true ||
1919 Whitelist . Contains ( emailAddress ) ) )
2020 {
Original file line number Diff line number Diff line change 11using Microsoft . AspNetCore . Authorization ;
22
3- namespace GradeManagement . Client . Authorization . Policies ;
3+ namespace GradeManagement . Shared . Authorization . Policies ;
44
55public class TeacherRequirement : IAuthorizationRequirement
66{
You can’t perform that action at this time.
0 commit comments