mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2540] Lock node feature (#3138)
* add adf-node-lock directive * add lock-node service + button in context menu * unit tests * docs * unit tests fix * Remove unnecessary imports * PR changes * Remove fit from tests * Update specific node from list on lock/ulock
This commit is contained in:
committed by
Denys Vuika
parent
7b7e39d989
commit
7d1b4bf14a
@@ -202,9 +202,9 @@ export class ContentService {
|
||||
|
||||
if (this.hasAllowableOperations(node)) {
|
||||
if (permission && permission.startsWith('!')) {
|
||||
hasPermission = node.allowableOperations.find(currentPermission => currentPermission === permission.replace('!', '')) ? false : true;
|
||||
hasPermission = !~node.allowableOperations.indexOf(permission.replace('!', ''));
|
||||
} else {
|
||||
hasPermission = node.allowableOperations.find(currentPermission => currentPermission === permission) ? true : false;
|
||||
hasPermission = !!~node.allowableOperations.indexOf(permission);
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -217,6 +217,14 @@ export class ContentService {
|
||||
hasPermission = true;
|
||||
}
|
||||
|
||||
if (permission === PermissionsEnum.LOCK) {
|
||||
hasPermission = node.isFile;
|
||||
|
||||
if (node.isLocked && this.hasAllowableOperations(node)) {
|
||||
hasPermission = !!~node.allowableOperations.indexOf('updatePermissions');
|
||||
}
|
||||
}
|
||||
|
||||
return hasPermission;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user