mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[MNT-24923] legal hold hold capabilities are not verified properly (#4616)
* [MNT-24923] Added possibility to configure readonly for metadata sidebar by json config * [MNT-24923] Unit tests * [MNT-24923] Fixed sonar issues
This commit is contained in:
@@ -40,6 +40,7 @@ import { CommonModule } from '@angular/common';
|
||||
import { Actions, ofType } from '@ngrx/effects';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
import { ExtensionService } from '@alfresco/adf-extensions';
|
||||
|
||||
@Component({
|
||||
standalone: true,
|
||||
@@ -81,15 +82,16 @@ export class MetadataTabComponent implements OnInit {
|
||||
private readonly destroyRef = inject(DestroyRef);
|
||||
|
||||
constructor(
|
||||
private permission: NodePermissionService,
|
||||
protected extensions: AppExtensionService,
|
||||
private appConfig: AppConfigService,
|
||||
private notificationService: NotificationService,
|
||||
private contentMetadataService: ContentMetadataService,
|
||||
private actions$: Actions,
|
||||
private tagService: TagService,
|
||||
private categoryService: CategoryService,
|
||||
private store: Store<AppStore>
|
||||
private readonly permission: NodePermissionService,
|
||||
protected readonly extensions: AppExtensionService,
|
||||
private readonly appConfig: AppConfigService,
|
||||
private readonly notificationService: NotificationService,
|
||||
private readonly contentMetadataService: ContentMetadataService,
|
||||
private readonly actions$: Actions,
|
||||
private readonly tagService: TagService,
|
||||
private readonly categoryService: CategoryService,
|
||||
private readonly store: Store<AppStore>,
|
||||
private readonly extensionService: ExtensionService
|
||||
) {
|
||||
if (this.extensions.contentMetadata) {
|
||||
this.appConfig.config['content-metadata'].presets = this.extensions.contentMetadata.presets;
|
||||
@@ -128,6 +130,12 @@ export class MetadataTabComponent implements OnInit {
|
||||
}
|
||||
|
||||
private checkIfNodeIsUpdatable(node: Node) {
|
||||
this.readOnly = !(node && !isLocked({ entry: node }) ? this.permission.check(node, ['update']) : false);
|
||||
this.readOnly = !(node &&
|
||||
!isLocked({ entry: node }) &&
|
||||
(this.extensionService.getFeature('sidebar')?.['rules']?.enabled ?? []).every((rule: string) =>
|
||||
this.extensionService.evaluateRule(rule, this.extensions)
|
||||
)
|
||||
? this.permission.check(node, ['update'])
|
||||
: false);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user