Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ public interface INavigationPermissionService
/// <param name="user">User.</param>
/// <param name="loginWizardComplete">Login wizard complete.</param>
/// <param name="controllerName">Controller name.</param>
/// <param name="currentUserId">The current user id.</param>
/// <returns>A <see cref="Task{TResult}"/> representing the result of the asynchronous operation.</returns>
Task<NavigationModel> GetNavigationModelAsync(IPrincipal user, bool loginWizardComplete, string controllerName);
Task<NavigationModel> GetNavigationModelAsync(IPrincipal user, bool loginWizardComplete, string controllerName, int currentUserId);

/// <summary>
/// The NotAuthenticated.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ public NavigationPermissionService(IResourceService resourceService, IUserGroupS
/// <param name="user">The user<see cref="IPrincipal"/>.</param>
/// <param name="loginWizardComplete">The loginWizardComplete<see cref="bool"/>.</param>
/// <param name="controllerName">The controller name.</param>
/// <param name="currentUserId">The current user id.</param>
/// <returns>The <see cref="Task{NavigationModel}"/>.</returns>
public async Task<NavigationModel> GetNavigationModelAsync(IPrincipal user, bool loginWizardComplete, string controllerName)
public async Task<NavigationModel> GetNavigationModelAsync(IPrincipal user, bool loginWizardComplete, string controllerName, int currentUserId)
{
if (!loginWizardComplete && (user.IsInRole("Administrator") || user.IsInRole("ReadOnly") || user.IsInRole("BlueUser") || user.IsInRole("BasicUser")))
{
Expand All @@ -48,15 +49,15 @@ public async Task<NavigationModel> GetNavigationModelAsync(IPrincipal user, bool
}
else if (user.IsInRole("ReadOnly"))
{
return await AuthenticatedReadOnly(controllerName,user.Identity.GetCurrentUserId());
return await AuthenticatedReadOnly(controllerName, currentUserId);
}
else if (user.IsInRole("BasicUser"))
{
return await AuthenticatedBasicUserOnly(user.Identity.GetCurrentUserId());
return await AuthenticatedBasicUserOnly(currentUserId);
}
else if (user.IsInRole("BlueUser"))
{
return await AuthenticatedBlueUser(controllerName, user.Identity.GetCurrentUserId());
return await AuthenticatedBlueUser(controllerName, currentUserId);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ public async Task<List<Dictionary<string, object>>> GetLHUserNavigation()

var (cacheExists, _) = await this.cacheService.TryGetAsync<string>($"{userId}:LoginWizard");

model = await this.permissionService.GetNavigationModelAsync(this.User, !cacheExists, string.Empty);
model = await this.permissionService.GetNavigationModelAsync(this.User, !cacheExists, string.Empty, userId);

model.NotificationCount = await this.userNotificationService.GetUserUnreadNotificationCountAsync(userId);
}
Expand Down
Loading