Skip to content

Commit

Permalink
User with human readable name cannot grant access to their PLP and PLE
Browse files Browse the repository at this point in the history
#2714 (#2717)

* User with human readable name cannot grant access to their PLP and PLE #2714

* User with human readable name cannot grant access to their PLP and PLE #2714
  • Loading branch information
anton-abushkevich authored Jun 23, 2022
1 parent 419ba77 commit 1191a76
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
12 changes: 4 additions & 8 deletions js/pages/estimation/cca-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ define([
GlobalPermissionService.decorateComponent(this, {
entityTypeGetter: () => entityType.ESTIMATION,
entityIdGetter: () => this.selectedAnalysisId(),
createdByUsernameGetter: () => this.estimationAnalysis() && lodash.get(this.estimationAnalysis(), 'createdBy')
createdByUsernameGetter: () => this.estimationAnalysis() && lodash.get(this.estimationAnalysis(), 'createdBy.login')
});
}

Expand Down Expand Up @@ -402,14 +402,10 @@ define([
}

setParsedAnalysis(header, specification) {
// ignore createdBy and modifiedBy
const { createdBy, modifiedBy, ...props } = header;
this.selectedAnalysisId(header.id);
this.estimationAnalysis(new EstimationAnalysis({
...specification,
...props,
createdBy: createdBy ? createdBy.name : null,
modifiedBy: modifiedBy ? modifiedBy.name : null
...header,
}, this.estimationType, this.defaultCovariateSettings()));
this.estimationAnalysis().id(header.id);
this.estimationAnalysis().name(header.name);
Expand Down Expand Up @@ -582,9 +578,9 @@ define([
const createdDate = commonUtils.formatDateForAuthorship(this.estimationAnalysis().createdDate);
const modifiedDate = commonUtils.formatDateForAuthorship(this.estimationAnalysis().modifiedDate);
return {
createdBy: lodash.get(this.estimationAnalysis(), 'createdBy'),
createdBy: lodash.get(this.estimationAnalysis(), 'createdBy.name'),
createdDate,
modifiedBy: lodash.get(this.estimationAnalysis(), 'modifiedBy'),
modifiedBy: lodash.get(this.estimationAnalysis(), 'modifiedBy.name'),
modifiedDate,
}
}
Expand Down
11 changes: 4 additions & 7 deletions js/pages/prediction/prediction-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ define([
GlobalPermissionService.decorateComponent(this, {
entityTypeGetter: () => entityType.PREDICTION,
entityIdGetter: () => this.selectedAnalysisId(),
createdByUsernameGetter: () => this.patientLevelPredictionAnalysis() && lodash.get(this.patientLevelPredictionAnalysis(), 'createdBy')
createdByUsernameGetter: () => this.patientLevelPredictionAnalysis() && lodash.get(this.patientLevelPredictionAnalysis(), 'createdBy.login')
});
}

Expand Down Expand Up @@ -414,12 +414,9 @@ define([
}

loadParsedAnalysisFromServer(header, specification) {
const { createdBy, modifiedBy, ...props } = header;
this.patientLevelPredictionAnalysis(new PatientLevelPredictionAnalysis({
...specification,
...props,
createdBy: createdBy ? createdBy.name : null,
modifiedBy: modifiedBy ? modifiedBy.name : null
...header,
}));
this.packageName(header.packageName);
this.setUserInterfaceDependencies();
Expand Down Expand Up @@ -480,9 +477,9 @@ define([
const createdDate = commonUtils.formatDateForAuthorship(this.patientLevelPredictionAnalysis().createdDate);
const modifiedDate = commonUtils.formatDateForAuthorship(this.patientLevelPredictionAnalysis().modifiedDate);
return {
createdBy: lodash.get(this.patientLevelPredictionAnalysis(), 'createdBy'),
createdBy: lodash.get(this.patientLevelPredictionAnalysis(), 'createdBy.name'),
createdDate,
modifiedBy: lodash.get(this.patientLevelPredictionAnalysis(), 'modifiedBy'),
modifiedBy: lodash.get(this.patientLevelPredictionAnalysis(), 'modifiedBy.name'),
modifiedDate,
}
}
Expand Down

0 comments on commit 1191a76

Please sign in to comment.