This commit is contained in:
@@ -1,10 +1,23 @@
|
||||
@page "/"
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@using TechHelper.Client.Pages.Common.Exam
|
||||
|
||||
<TechHelper.Client.Pages.Teacher.StudentsView/>
|
||||
<AuthorizeView Roles="Student">
|
||||
<Authorized>
|
||||
<TechHelper.Client.Pages.Student.HomePage />
|
||||
</Authorized>
|
||||
</AuthorizeView>
|
||||
|
||||
|
||||
<AssignmentInfoCard></AssignmentInfoCard>
|
||||
|
||||
@code {
|
||||
[CascadingParameter]
|
||||
private Task<AuthenticationState> authenticationStateTask { get; set; }
|
||||
|
||||
protected override Task OnInitializedAsync()
|
||||
{
|
||||
return base.OnInitializedAsync();
|
||||
Console.WriteLine(authenticationStateTask.Result.User.IsInRole("Student"));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user