@@ -13,7 +13,11 @@ import {
1313 selectHasSkillsReportPermission ,
1414 selectHasTeamSkillsReportPermission ,
1515 selectHasViewPulseReportPermission ,
16- selectIsAdmin
16+ selectIsAdmin ,
17+ selectHasEarnedCertificationsPermission ,
18+ selectHasMeritReportPermission ,
19+ selectHasVolunteeringEventsPermission ,
20+ selectHasVolunteeringRelationshipsPermission ,
1721} from '../../context/selectors' ;
1822import { UPDATE_TOAST } from '../../context/actions' ;
1923
@@ -136,7 +140,9 @@ function Menu({ children }) {
136140 links . push ( [ '/birthday-reports' , 'Birthdays' ] ) ;
137141 }
138142
139- links . push ( [ '/certification-reports' , 'Certifications' ] ) ;
143+ if ( selectHasEarnedCertificationsPermission ( state ) ) {
144+ links . push ( [ '/certification-reports' , 'Certifications' ] ) ;
145+ }
140146
141147 if ( selectHasCheckinsReportPermission ( state ) ) {
142148 links . push ( [ '/checkins-reports' , 'Check-ins' ] ) ;
@@ -154,8 +160,14 @@ function Menu({ children }) {
154160 links . push ( [ '/team-skills-reports' , 'Team Skills' ] ) ;
155161 }
156162
157- links . push ( [ '/merit-reports' , 'Merit Report' ] ) ;
158- links . push ( [ '/volunteer-reports' , 'Volunteering' ] ) ;
163+ if ( selectHasMeritReportPermission ( state ) ) {
164+ links . push ( [ '/merit-reports' , 'Merit Report' ] ) ;
165+ }
166+
167+ if ( selectHasVolunteeringEventsPermission ( state ) ||
168+ selectHasVolunteeringRelationshipsPermission ( state ) ) {
169+ links . push ( [ '/volunteer-reports' , 'Volunteering' ] ) ;
170+ }
159171
160172 return links ;
161173 } ;
0 commit comments