[ACA-1236] Manage Versions - of Shared Files (#251)

* you can't open version history for multiple files selected

* update node-version directive to handle the node versions of shared files
This commit is contained in:
suzanadirla
2018-03-24 09:15:32 +02:00
committed by Denys Vuika
parent abe244fed9
commit 15c361c962
4 changed files with 29 additions and 8 deletions

View File

@@ -136,13 +136,20 @@ export abstract class PageComponent {
return this.isFileSelected(selection);
}
canManageVersions(selection: Array<MinimalNodeEntity>): boolean {
const lastItem = selection.length && selection[selection.length - 1].entry;
return lastItem && lastItem.isFile && this.userHasPermissionToManageVersions(lastItem);
canUpdateFile(selection: Array<MinimalNodeEntity>): boolean {
return this.isFileSelected(selection) && this.nodeHasPermission(selection[0].entry, 'update');
}
userHasPermissionToManageVersions(nodeEntry): boolean {
return this.nodeHasPermission(nodeEntry, 'update');
canUpdateFileShared(selection: Array<MinimalNodeEntity>): boolean {
return this.isFileSelected(selection) && this.nodeSharedHasPermission(selection[0].entry, 'update');
}
canManageVersions(selection: Array<MinimalNodeEntity>): boolean {
return this.canUpdateFile(selection);
}
canManageVersionsOfShared(selection: Array<MinimalNodeEntity>): boolean {
return this.canUpdateFileShared(selection);
}
nodeHasPermission(node: MinimalNodeEntryEntity, permission: string): boolean {