has permission cosnumer skip logic

This commit is contained in:
Eugenio Romano
2019-02-13 15:01:26 +00:00
parent 801d9bfff8
commit 469bb214b5
5 changed files with 23 additions and 4 deletions

View File

@@ -4,7 +4,7 @@
<adf-info-drawer [title]="'APP.INFO_DRAWER.TITLE' | translate">
<adf-info-drawer-tab [label]="'APP.INFO_DRAWER.COMMENTS' | translate">
<adf-comments [nodeId]="nodeId" [readOnly]="isCommentEnabled"></adf-comments>
<adf-comments [nodeId]="nodeId" [readOnly]="isCommentDisabled"></adf-comments>
</adf-info-drawer-tab>
<adf-info-drawer-tab [label]="'APP.INFO_DRAWER.PROPERTIES' | translate">

View File

@@ -52,7 +52,7 @@ export class FileViewComponent implements OnInit {
showLeftSidebar = null;
showRightSidebar = false;
customToolbar = false;
isCommentEnabled = true;
isCommentDisabled = false;
constructor(private router: Router,
private route: ActivatedRoute,
@@ -68,7 +68,7 @@ export class FileViewComponent implements OnInit {
this.nodeApiService.getNode(id).subscribe(
(node) => {
if (node && node.isFile) {
this.isCommentEnabled = !this.contentServices.hasPermissions(node, PermissionsEnum.NOT_CONSUMER);
this.isCommentDisabled = this.contentServices.hasPermissions(node, PermissionsEnum.CONSUMER);
this.nodeId = id;
return;
}