Skip to content

Commit

Permalink
add QA authorization config
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescoMolinaro committed Dec 15, 2023
1 parent f2be578 commit f7be255
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/app/core/data/feature-authorization/feature-id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ export enum FeatureID {
CanEditItem = 'canEditItem',
CanRegisterDOI = 'canRegisterDOI',
CanSubscribe = 'canSubscribeDso',
CanSeeQA = 'canSeeQA'
}
8 changes: 6 additions & 2 deletions src/app/menu.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -530,13 +530,17 @@ export class MenuResolver implements Resolve<boolean> {
* Create menu sections dependent on whether or not the current user is a site administrator
*/
createSiteAdministratorMenuSections() {
this.authorizationService.isAuthorized(FeatureID.AdministratorOf).subscribe((authorized) => {
combineLatest([
this.authorizationService.isAuthorized(FeatureID.AdministratorOf),
this.authorizationService.isAuthorized(FeatureID.CanSeeQA)
])
.subscribe(([authorized, canSeeQA]) => {
const menuList = [
/* Notifications */
{
id: 'notifications',
active: false,
visible: authorized,
visible: authorized && canSeeQA,
model: {
type: MenuItemType.TEXT,
text: 'menu.section.notifications'
Expand Down

0 comments on commit f7be255

Please sign in to comment.