diff --git a/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts b/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts index 3ce790c8d..c17692525 100644 --- a/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts +++ b/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts @@ -164,7 +164,7 @@ export class DatasetOverviewComponent extends BaseComponent implements OnInit { setIsUserOwner() { if (this.dataset) { const principal: Principal = this.authentication.current(); - if (principal) this.isUserOwner = principal.id === this.dataset.users.find(x => x.role === Role.Owner).id; + if (principal) this.isUserOwner = !!this.dataset.users.find(x => (x.role === Role.Owner) && (principal.id === x.id)); } } diff --git a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts index 5e203919a..5ecfee18d 100644 --- a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts +++ b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts @@ -167,7 +167,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { setIsUserOwner() { if (this.dmp) { const principal: Principal = this.authentication.current(); - if (principal) this.isUserOwner = principal.id === this.dmp.users.find(x => x.role === Role.Owner).id; + if (principal) this.isUserOwner = !!this.dmp.users.find(x => (x.role === Role.Owner) && (principal.id === x.id)); } }