rename old hasPermission as allowableOperation and introduce the real hasPermissions (#4294)

This commit is contained in:
Eugenio Romano
2019-02-11 10:44:37 +00:00
committed by GitHub
parent 324e86aaf3
commit 3263659ac2
39 changed files with 256 additions and 178 deletions

View File

@@ -17,7 +17,7 @@
/* tslint:disable:no-input-rename */
import { Directive, Input, Output, EventEmitter } from '@angular/core';
import { NodesApiService, ContentService, PermissionsEnum } from '@alfresco/adf-core';
import { NodesApiService, ContentService, AllowableOperationsEnum } from '@alfresco/adf-core';
import { Node } from '@alfresco/js-api';
@Directive({
@@ -47,7 +47,7 @@ export class InheritPermissionDirective {
onInheritPermissionClicked() {
this.nodeService.getNode(this.nodeId).subscribe((node: Node) => {
if (this.contentService.hasPermission(node, PermissionsEnum.UPDATEPERMISSIONS)) {
if (this.contentService.hasAllowableOperations(node, AllowableOperationsEnum.UPDATEPERMISSIONS)) {
const nodeBody = { permissions: { isInheritanceEnabled: !node.permissions.isInheritanceEnabled } };
this.nodeService.updateNode(this.nodeId, nodeBody, { include: ['permissions'] }).subscribe((nodeUpdated: Node) => {
this.updated.emit(nodeUpdated);