Skip to content

Commit 70590f2

Browse files
authored
Merge pull request #1478 from TechnologyEnhancedLearning/Develop/Fixes/CataloguePermissionfix
Menu is not working in Moodle API
2 parents 4f40d5d + 59a4a45 commit 70590f2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/NavigationPermissionService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ private async Task<NavigationModel> AuthenticatedReadOnly(string controllerName,
172172
{
173173
return new NavigationModel()
174174
{
175-
ShowMyContributions = await this.userGroupService.UserHasCatalogueContributionPermission(userId),
175+
ShowMyContributions = await resourceService.HasPublishedResourcesAsync(userId),
176176
ShowMyLearning = true,
177177
ShowMyBookmarks = false,
178178
ShowSearch = controllerName != "search" && controllerName != string.Empty,
@@ -196,7 +196,7 @@ private async Task<NavigationModel> AuthenticatedBasicUserOnly(int userId)
196196
{
197197
return new NavigationModel()
198198
{
199-
ShowMyContributions = await this.userGroupService.UserHasCatalogueContributionPermission(userId),
199+
ShowMyContributions = await resourceService.HasPublishedResourcesAsync(userId),
200200
ShowMyLearning = true,
201201
ShowMyBookmarks = false,
202202
ShowSearch = true,

OpenAPI/LearningHub.Nhs.OpenApi/Controllers/UserController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ public async Task<List<Dictionary<string, object>>> GetLHUserNavigation()
341341
}
342342
else
343343
{
344-
var userId = this.User.Identity.GetCurrentUserId();
344+
var userId = this.CurrentUserId.GetValueOrDefault();
345345

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

0 commit comments

Comments
 (0)