[ACS-9765]: cr

This commit is contained in:
Anton Ramanovich
2026-03-11 20:40:55 +01:00
parent 71c020d8be
commit 48ea5f71f2
4 changed files with 9 additions and 12 deletions
@@ -42,7 +42,7 @@ describe('CommentsTabComponent', () => {
imports: [NoopTranslateModule, CommentsTabComponent],
providers: [
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
{ provide: EXTERNAL_NODE_PERMISSION_COMMENTS_TAB_SERVICE, useValue: [{ canAddComments: () => canAddComment }] },
{ provide: EXTERNAL_NODE_PERMISSION_COMMENTS_TAB_SERVICE, useValue: { canAddComments: () => canAddComment }, multi: true },
{ provide: AuthenticationService, useValue: { onLogout: of({}) } }
]
});
@@ -58,12 +58,9 @@ export class CommentsTabComponent implements OnInit {
ngOnInit(): void {
if (!this.node) {
this.canUpdateNode = false;
}
if (this.node.isFolder || (this.node.isFile && !isLocked({ entry: this.node }))) {
this.canUpdateNode = this.permission.check(this.node, ['update']);
if (this.externalPermissionNodeService?.length) {
this.canUpdateNode &&= this.externalPermissionNodeService.every((service) => service.canAddComments(this.node));
}
} else if (this.node.isFolder || (this.node.isFile && !isLocked({ entry: this.node }))) {
this.canUpdateNode =
this.permission.check(this.node, ['update']) && this.externalPermissionNodeService.every((service) => service.canAddComments(this.node));
}
}
}