Skip to content

Commit

Permalink
Remove RESTRICTED_DELEGATORS as well
Browse files Browse the repository at this point in the history
  • Loading branch information
amontenegro committed Dec 14, 2023
1 parent c2c60e2 commit 9c2d3c5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
7 changes: 2 additions & 5 deletions src/app/guards/authenticated-no-delagator.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,14 @@ export class AuthenticatedNoDelegatorGuard {
| boolean
| UrlTree {
return combineLatest([
this._togglz.getStateOf('RESTRICTED_DELEGATORS'),
this._userInfo.getUserSession(),
]).pipe(
map((value) => {
const restrictedDelegators = value[0]
const userSession = value[1]
const userSession = value[0]
if (
(userSession.loggedIn &&
userSession.userInfo.IN_DELEGATION_MODE === 'false') ||
userSession.userInfo.DELEGATED_BY_ADMIN === 'true' ||
!restrictedDelegators
userSession.userInfo.DELEGATED_BY_ADMIN === 'true'
) {
return true
} else {
Expand Down
3 changes: 1 addition & 2 deletions src/app/layout/user-menu/user-menu.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@
*ngIf="
userInfo &&
(userInfo['IN_DELEGATION_MODE'] === 'false' ||
userInfo['DELEGATED_BY_ADMIN'] === 'true' ||
!restrictedDelegators)
userInfo['DELEGATED_BY_ADMIN'] === 'true')
"
>
<mat-icon>settings</mat-icon>
Expand Down
6 changes: 1 addition & 5 deletions src/app/layout/user-menu/user-menu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export class UserMenuComponent implements OnInit {
labelSigninRegister = $localize`:@@layout.ariaLabelSigninRegister:Sign in to ORCID or register for your ORCID iD`
labelUserMenu = $localize`:@@layout.ariaLabelUserMenu:User menu`
isAccountDelegate: boolean
restrictedDelegators: boolean
inboxUnread = 0

constructor(
Expand All @@ -53,10 +52,7 @@ export class UserMenuComponent implements OnInit {
})
}

ngOnInit() {
this._togglz
.getStateOf('RESTRICTED_DELEGATORS')
.subscribe((value) => (this.restrictedDelegators = value))
ngOnInit() {
this._inboxService
.retrieveUnreadCount()
.pipe(first())
Expand Down

0 comments on commit 9c2d3c5

Please sign in to comment.