modified allowed actions flow

This commit is contained in:
Timo Bejan 2020-11-08 22:27:00 +02:00
parent 414d5518dc
commit 7f3a0168c3

View File

@ -245,9 +245,7 @@ export class AppStateService {
}
get canMarkPagesAsViewedForActiveFile() {
return (
this.activeFile.status === 'UNDER_APPROVAL' || this.activeFile.status === 'UNDER_REVIEW'
);
return this.canPerformAnnotationActionsOnCurrentFile();
}
public getProjectById(id: string) {
@ -602,13 +600,18 @@ export class AppStateService {
}
canPerformAnnotationActionsOnCurrentFile() {
const status = this.activeFile.status;
if (status === 'UNDER_REVIEW') {
return this.isActiveProjectOwnerAndManager || this.isActiveFileDocumentReviewer;
}
if (status === 'UNDER_APPROVAL') {
return this.isActiveProjectOwnerAndManager;
}
return false;
// const status = this.activeFile.status;
// if (status === 'UNDER_REVIEW') {
// return this.isActiveProjectOwnerAndManager || this.isActiveFileDocumentReviewer;
// }
// if (status === 'UNDER_APPROVAL') {
// return this.isActiveProjectOwnerAndManager;
// }
// return false;
return (
(this.activeFile.status === 'UNDER_APPROVAL' ||
this.activeFile.status === 'UNDER_REVIEW') &&
this._userService.userId === this.activeFile.currentReviewer
);
}
}