[ACA-1113] Node Permissions - experimental (#501)

* [ACA-1113] Integrate permissions

* [ACA-1113] experimental flag for permissions

* [ACA-1113] permissions shown only on write permission

* [ACA-1113] remove console.logs
This commit is contained in:
Suzana Dirla
2018-07-09 17:20:54 +03:00
committed by Denys Vuika
parent 85c0e42047
commit 7a95485a05
17 changed files with 371 additions and 1 deletions

View File

@@ -54,6 +54,7 @@ export abstract class PageComponent implements OnInit, OnDestroy {
sharedPreviewUrl$: Observable<string>;
actions: Array<ContentActionExtension> = [];
canUpdateFile = false;
canUpdateNode = false;
canDelete = false;
canEditFolder = false;
canUpload = false;
@@ -84,6 +85,7 @@ export abstract class PageComponent implements OnInit, OnDestroy {
}
this.actions = this.extensions.getSelectedContentActions(selection, this.node);
this.canUpdateFile = this.selection.file && this.content.canUpdateNode(selection.file);
this.canUpdateNode = this.selection.count === 1 && this.content.canUpdateNode(selection.first);
this.canDelete = !this.selection.isEmpty && this.content.canDeleteNodes(selection.nodes);
this.canEditFolder = selection.folder && this.content.canUpdateNode(selection.folder);
this.canDeleteShared = !this.selection.isEmpty && this.content.canDeleteSharedNodes(selection.nodes);