@@ -13,7 +13,12 @@ import {
1313 selectHasSkillsReportPermission ,
1414 selectHasTeamSkillsReportPermission ,
1515 selectHasViewPulseReportPermission ,
16- selectIsAdmin
16+ selectIsAdmin ,
17+ selectHasEarnedCertificationsPermission ,
18+ selectHasMeritReportPermission ,
19+ selectHasVolunteeringEventsPermission ,
20+ selectHasVolunteeringOrganizationsPermission ,
21+ selectHasVolunteeringRelationshipsPermission ,
1722} from '../../context/selectors' ;
1823import { UPDATE_TOAST } from '../../context/actions' ;
1924
@@ -136,7 +141,9 @@ function Menu({ children }) {
136141 links . push ( [ '/birthday-reports' , 'Birthdays' ] ) ;
137142 }
138143
139- links . push ( [ '/certification-reports' , 'Certifications' ] ) ;
144+ if ( selectHasEarnedCertificationsPermission ( state ) ) {
145+ links . push ( [ '/certification-reports' , 'Certifications' ] ) ;
146+ }
140147
141148 if ( selectHasCheckinsReportPermission ( state ) ) {
142149 links . push ( [ '/checkins-reports' , 'Check-ins' ] ) ;
@@ -154,8 +161,14 @@ function Menu({ children }) {
154161 links . push ( [ '/team-skills-reports' , 'Team Skills' ] ) ;
155162 }
156163
157- links . push ( [ '/merit-reports' , 'Merit Report' ] ) ;
158- links . push ( [ '/volunteer-reports' , 'Volunteering' ] ) ;
164+ if ( selectHasMeritReportPermission ( state ) ) {
165+ links . push ( [ '/merit-reports' , 'Merit Report' ] ) ;
166+ }
167+
168+ if ( selectHasVolunteeringEventsPermission ( state ) ||
169+ selectHasVolunteeringRelationshipsPermission ( state ) ) {
170+ links . push ( [ '/volunteer-reports' , 'Volunteering' ] ) ;
171+ }
159172
160173 return links ;
161174 } ;
0 commit comments