mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-3228] Added lock check for context actions (#4163)
* [ADF-3228] Added lock check in content service * [ADF-3228] added unit test for lock check * [ADF-3228] fixed wrong line on rebase * [ADF-3228] fixed e2e related to new lock behaviour * [ADF-3228] externalised lock service and added more unit tests * [ADF-3228] added lock service to disable context actions * [ADF-3228] fixed e2e rebased to the latest
This commit is contained in:
@@ -42,7 +42,8 @@ import {
|
||||
CustomEmptyContentTemplateDirective,
|
||||
RequestPaginationModel,
|
||||
AlfrescoApiService,
|
||||
UserPreferenceValues
|
||||
UserPreferenceValues,
|
||||
LockService
|
||||
} from '@alfresco/adf-core';
|
||||
|
||||
import { Node, NodeEntry, NodePaging, Pagination } from '@alfresco/js-api';
|
||||
@@ -325,7 +326,8 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
||||
private customResourcesService: CustomResourcesService,
|
||||
private contentService: ContentService,
|
||||
private thumbnailService: ThumbnailService,
|
||||
private alfrescoApiService: AlfrescoApiService) {
|
||||
private alfrescoApiService: AlfrescoApiService,
|
||||
private lockService: LockService) {
|
||||
|
||||
this.userPreferencesService.select(UserPreferenceValues.PaginationSize).subscribe((pagSize) => {
|
||||
this.maxItems = this._pagination.maxItems = pagSize;
|
||||
@@ -532,11 +534,14 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
||||
return action.disabled(node);
|
||||
}
|
||||
|
||||
if (action.permission && action.disableWithNoPermission && !this.contentService.hasAllowableOperations(node.entry, action.permission)) {
|
||||
if ((action.permission &&
|
||||
action.disableWithNoPermission &&
|
||||
!this.contentService.hasAllowableOperations(node.entry, action.permission)) ||
|
||||
this.lockService.isLocked(node.entry)) {
|
||||
return true;
|
||||
} else {
|
||||
return action.disabled;
|
||||
}
|
||||
|
||||
return action.disabled;
|
||||
}
|
||||
|
||||
@HostListener('contextmenu', ['$event'])
|
||||
|
Reference in New Issue
Block a user