@@ -12,12 +12,13 @@ import { toSignal } from '@angular/core/rxjs-interop';
1212import { ActivatedRoute , NavigationEnd , Router , RouterLink , RouterLinkActive } from '@angular/router' ;
1313
1414import { MENU_ITEMS } from '@core/constants' ;
15+ import { ProviderSelectors } from '@core/store/provider' ;
1516import { filterMenuItems , updateMenuItems } from '@osf/core/helpers' ;
1617import { RouteContext } from '@osf/core/models' ;
1718import { AuthService } from '@osf/core/services' ;
1819import { UserSelectors } from '@osf/core/store/user' ;
1920import { IconComponent } from '@osf/shared/components' ;
20- import { CurrentResourceType } from '@osf/shared/enums' ;
21+ import { CurrentResourceType , ReviewPermissions } from '@osf/shared/enums' ;
2122import { getViewOnlyParam } from '@osf/shared/helpers' ;
2223import { WrapFnPipe } from '@osf/shared/pipes' ;
2324import { CurrentResourceSelectors } from '@osf/shared/stores' ;
@@ -37,14 +38,15 @@ export class NavMenuComponent {
3738
3839 private readonly isAuthenticated = select ( UserSelectors . isAuthenticated ) ;
3940 private readonly currentResource = select ( CurrentResourceSelectors . getCurrentResource ) ;
41+ private readonly provider = select ( ProviderSelectors . getCurrentProvider ) ;
4042
4143 readonly mainMenuItems = computed ( ( ) => {
4244 const isAuthenticated = this . isAuthenticated ( ) ;
4345 const filtered = filterMenuItems ( MENU_ITEMS , isAuthenticated ) ;
4446
4547 const routeContext : RouteContext = {
4648 resourceId : this . currentResourceId ( ) ,
47- providerId : this . currentProviderId ( ) ,
49+ providerId : this . provider ( ) ?. id ,
4850 isProject :
4951 this . currentResource ( ) ?. type === CurrentResourceType . Projects &&
5052 this . currentResourceId ( ) === this . currentResource ( ) ?. id ,
@@ -53,6 +55,12 @@ export class NavMenuComponent {
5355 this . currentResourceId ( ) === this . currentResource ( ) ?. id ,
5456 isPreprint : this . isPreprintRoute ( ) ,
5557 preprintReviewsPageVisible : this . canUserViewReviews ( ) ,
58+ registrationModerationPageVisible :
59+ this . provider ( ) ?. type === CurrentResourceType . Registrations &&
60+ this . provider ( ) ?. permissions ?. includes ( ReviewPermissions . ViewSubmissions ) ,
61+ collectionModerationPageVisible :
62+ this . provider ( ) ?. type === CurrentResourceType . Collections &&
63+ this . provider ( ) ?. permissions ?. includes ( ReviewPermissions . ViewSubmissions ) ,
5664 isCollections : this . isCollectionsRoute ( ) || false ,
5765 currentUrl : this . router . url ,
5866 isViewOnly : ! ! getViewOnlyParam ( this . router ) ,
0 commit comments