mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2026-09-09 18:02:54 +00:00
[ACS-9765]: cr
This commit is contained in:
+1
-1
@@ -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({}) } }
|
||||
]
|
||||
});
|
||||
|
||||
+3
-6
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user