Navmenu related to current authorized user's role

This commit is contained in:
2024-09-12 00:08:22 +03:00
parent 96c70ef0ba
commit 18e02792ec
7 changed files with 50 additions and 15 deletions

View File

@@ -199,7 +199,7 @@
try
{
var applicationId = Guid.Parse(ApplicationId);
currentRole = UserDataProvider.GetCurrentRole() ?? throw new NotLoggedInException();
currentRole = UserDataProvider.CurrentRole ?? throw new NotLoggedInException();
application = currentRole switch
{

View File

@@ -60,7 +60,14 @@
protected override async Task OnInitializedAsync()
{
currentRole = UserDataProvider.GetCurrentRole()!;
try
{
currentRole = UserDataProvider.CurrentRole ?? throw new NotLoggedInException();
}
catch (Exception e)
{
ErrorHandler.Handle(e);
}
await Fetch();
}

View File

@@ -178,7 +178,7 @@
@if (isNonResident)
{
requestModel.ReentryPermit = NewReentryPermit();
requestModel.ReentryPermit ??= NewReentryPermit();
<div class="form-block">
<h5>Re-entry permission@(Constants.RequiredFieldMarkup)</h5>
<ReentryPermitInput ReentryPermit="requestModel.ReentryPermit"/>