Commit fd9d35aa authored by Kristian Ntavidi's avatar Kristian Ntavidi
Browse files

Dataset and dmp overview fix.

* Fix edit issue when multiple users have ownership of the same dmp/dataset.
parent 72d88d9d
......@@ -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));
}
}
......
......@@ -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));
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment