|
11 | 11 | public class NavigationPermissionService : INavigationPermissionService |
12 | 12 | { |
13 | 13 | private readonly IResourceService resourceService; |
| 14 | + private readonly IUserGroupService userGroupService; |
14 | 15 |
|
15 | 16 | /// <summary> |
16 | 17 | /// Initializes a new instance of the <see cref="NavigationPermissionService"/> class. |
17 | 18 | /// </summary> |
18 | 19 | /// <param name="resourceService">Resource service.</param> |
19 | | - public NavigationPermissionService(IResourceService resourceService) |
| 20 | + /// <param name="userGroupService">UserGroup service.</param> |
| 21 | + public NavigationPermissionService( |
| 22 | + IResourceService resourceService, |
| 23 | + IUserGroupService userGroupService) |
20 | 24 | { |
21 | 25 | this.resourceService = resourceService; |
| 26 | + this.userGroupService = userGroupService; |
22 | 27 | } |
23 | 28 |
|
24 | 29 | /// <summary> |
@@ -52,7 +57,7 @@ public async Task<NavigationModel> GetNavigationModelAsync(IPrincipal user, bool |
52 | 57 | } |
53 | 58 | else if (user.IsInRole("BlueUser")) |
54 | 59 | { |
55 | | - return this.AuthenticatedBlueUser(controllerName); |
| 60 | + return await this.AuthenticatedBlueUser(controllerName); |
56 | 61 | } |
57 | 62 | else |
58 | 63 | { |
@@ -114,11 +119,11 @@ private NavigationModel AuthenticatedAdministrator(string controllerName) |
114 | 119 | /// </summary> |
115 | 120 | /// <param name="controllerName">The controller name.</param> |
116 | 121 | /// <returns>The <see cref="NavigationModel"/>.</returns> |
117 | | - private NavigationModel AuthenticatedBlueUser(string controllerName) |
| 122 | + private async Task<NavigationModel> AuthenticatedBlueUser(string controllerName) |
118 | 123 | { |
119 | 124 | return new NavigationModel() |
120 | 125 | { |
121 | | - ShowMyContributions = true, |
| 126 | + ShowMyContributions = await this.userGroupService.UserHasCatalogueContributionPermission(), |
122 | 127 | ShowMyLearning = true, |
123 | 128 | ShowMyBookmarks = true, |
124 | 129 | ShowSearch = controllerName != "search" && controllerName != string.Empty, |
|
0 commit comments