mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2077] [Destination picker] User should not be able to copy / mo… (#2978)
* [ADF-20177] [Destination picker] User should not be able to copy / move items into a site outside of the documentLibrary * [ADF-20177] added unit tests for the change * [ADF-2077] refactor code and unit tests after code review * [ADF-2077] more refactoring to make the unit tests messages more clear
This commit is contained in:
committed by
Eugenio Romano
parent
8f471d8beb
commit
d997f14565
@@ -88,7 +88,7 @@ export class ContentNodeDialogService {
|
||||
currentFolderId: contentEntry.parentId,
|
||||
imageResolver: this.imageResolver.bind(this),
|
||||
rowFilter : this.rowFilter.bind(this, contentEntry.id),
|
||||
isSelectionValid: this.hasEntityCreatePermission.bind(this),
|
||||
isSelectionValid: this.isCopyMoveSelectionValid.bind(this),
|
||||
select: select
|
||||
};
|
||||
|
||||
@@ -188,10 +188,18 @@ export class ContentNodeDialogService {
|
||||
return entry.isFolder;
|
||||
}
|
||||
|
||||
private isCopyMoveSelectionValid(entry: MinimalNodeEntryEntity): boolean {
|
||||
return this.hasEntityCreatePermission(entry) && !this.isSite(entry);
|
||||
}
|
||||
|
||||
private hasEntityCreatePermission(entry: MinimalNodeEntryEntity): boolean {
|
||||
return this.contentService.hasPermission(entry, 'create');
|
||||
}
|
||||
|
||||
private isSite(entry) {
|
||||
return !!entry.guid || entry.nodeType === 'st:site' || entry.nodeType === 'st:sites';
|
||||
}
|
||||
|
||||
/** Closes the currently open dialog. */
|
||||
close() {
|
||||
this.dialog.closeAll();
|
||||
|
Reference in New Issue
Block a user