Commit 8b1d285f authored by George Kalampokis's avatar George Kalampokis

Replace the DMP creator with the user roles on the User's profile (ref #224)

parent c2c837d5
......@@ -77,7 +77,13 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes
}
getUserRole(dmp: DmpModel) {
if (dmp.creator.id === this.currentUserId) { return this.language.instant('USER-PROFILE.DMPS.CREATOR'); } else if (dmp.associatedUsers.map(x => x.id).indexOf(this.currentUserId) !== -1) { return this.language.instant('USER-PROFILE.DMPS.MEMBER'); }
let role = -1;
dmp.users.forEach(user => {
if (user.id === this.currentUserId) {
role = user.role;
}
});
if (role === 0) { return this.language.instant('USER-PROFILE.DMPS.CREATOR'); } else if (role === 1) { return this.language.instant('USER-PROFILE.DMPS.MEMBER'); }
return '';
}
......
Markdown is supported
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