This commit is contained in:
Adina Țeudan 2021-12-07 05:43:05 +02:00
parent e4a9d87b99
commit 11e7090dc7

View File

@ -30,9 +30,15 @@ export class PermissionsService {
return file.assignee === this._userService.currentUser.id;
}
// https://jira.iqser.com/browse/RED-2787
canDeleteFile(file: File): boolean {
const dossier = this._getDossier(file);
return (this.isOwner(dossier) && !file.isApproved) || file.isNew;
return (
file.isNew ||
(file.isUnderReview && !file.assignee && this.isDossierMember(dossier)) ||
(file.isUnderApproval && !file.assignee && this.isApprover(dossier)) ||
(file.assignee && !file.isApproved && (this.isFileAssignee(file) || this.isOwner(dossier)))
);
}
canAssignToSelf(file: File, dossier = this._getDossier(file)): boolean {