mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2995] Permissions - Consumer should be able to upload a new version for his file on a private site (#3326)
* check node permission instead of parent * tests
This commit is contained in:
committed by
Eugenio Romano
parent
35ee120d5c
commit
374c5a3fed
@@ -15,7 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, forwardRef, Input, OnChanges, SimpleChanges, ViewEncapsulation } from '@angular/core';
|
||||
import { PermissionsEnum } from '@alfresco/adf-core';
|
||||
import { Component, forwardRef, Input, OnChanges, SimpleChanges, ViewEncapsulation, OnInit } from '@angular/core';
|
||||
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
|
||||
import { UploadButtonComponent } from './upload-button.component';
|
||||
import { FileModel, EXTENDIBLE_COMPONENT } from '@alfresco/adf-core';
|
||||
@@ -29,7 +30,7 @@ import { FileModel, EXTENDIBLE_COMPONENT } from '@alfresco/adf-core';
|
||||
],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class UploadVersionButtonComponent extends UploadButtonComponent implements OnChanges {
|
||||
export class UploadVersionButtonComponent extends UploadButtonComponent implements OnChanges, OnInit {
|
||||
|
||||
/** (**Required**) The node to be versioned. */
|
||||
@Input()
|
||||
@@ -57,4 +58,13 @@ export class UploadVersionButtonComponent extends UploadButtonComponent implemen
|
||||
|
||||
return fileModel;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
super.ngOnInit();
|
||||
this.checkPermission();
|
||||
}
|
||||
|
||||
checkPermission() {
|
||||
this.permissionValue.next(this.nodeHasPermission(this.node, PermissionsEnum.UPDATE));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user