mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
rename old hasPermission as allowableOperation and introduce the real hasPermissions (#4294)
This commit is contained in:
@@ -522,7 +522,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
||||
return action.disabled(node);
|
||||
}
|
||||
|
||||
if (action.permission && action.disableWithNoPermission && !this.contentService.hasPermission(node.entry, action.permission)) {
|
||||
if (action.permission && action.disableWithNoPermission && !this.contentService.hasAllowableOperations(node.entry, action.permission)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -54,7 +54,7 @@ export class ShareDataRow implements DataRow {
|
||||
|
||||
if (this.applyPermissionStyleToFolder(nodeEntity.entry, currentPermissionsStyle) || this.applyPermissionStyleToFile(nodeEntity.entry, currentPermissionsStyle)) {
|
||||
|
||||
if (this.contentService.hasPermission(nodeEntity.entry, currentPermissionsStyle.permission)) {
|
||||
if (this.contentService.hasAllowableOperations(nodeEntity.entry, currentPermissionsStyle.permission)) {
|
||||
permissionsClasses += ` ${currentPermissionsStyle.css}`;
|
||||
}
|
||||
}
|
||||
@@ -73,7 +73,7 @@ export class ShareDataRow implements DataRow {
|
||||
}
|
||||
|
||||
isFolderAndHasPermissionToUpload(nodeEntry: NodeEntry): boolean {
|
||||
return this.isFolder(nodeEntry) && this.contentService.hasPermission(nodeEntry.entry, 'create');
|
||||
return this.isFolder(nodeEntry) && this.contentService.hasAllowableOperations(nodeEntry.entry, 'create');
|
||||
}
|
||||
|
||||
isFolder(nodeEntry: NodeEntry): boolean {
|
||||
|
@@ -15,15 +15,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { PermissionsEnum } from '@alfresco/adf-core';
|
||||
import { AllowableOperationsEnum } from '@alfresco/adf-core';
|
||||
|
||||
export class PermissionStyleModel {
|
||||
css: string;
|
||||
permission: PermissionsEnum;
|
||||
permission: AllowableOperationsEnum;
|
||||
isFolder: boolean = true;
|
||||
isFile: boolean = true;
|
||||
|
||||
constructor(css: string, permission: PermissionsEnum, isFile: boolean = true, isFolder: boolean = true) {
|
||||
constructor(css: string, permission: AllowableOperationsEnum, isFile: boolean = true, isFolder: boolean = true) {
|
||||
this.css = css;
|
||||
this.permission = permission;
|
||||
this.isFile = isFile;
|
||||
|
@@ -122,7 +122,7 @@ export class DocumentActionsService {
|
||||
let handlerObservable;
|
||||
|
||||
if (this.canExecuteAction(node)) {
|
||||
if (this.contentService.hasPermission(node.entry, permission)) {
|
||||
if (this.contentService.hasAllowableOperations(node.entry, permission)) {
|
||||
handlerObservable = this.documentListService.deleteNode(node.entry.id);
|
||||
handlerObservable.subscribe(() => {
|
||||
let message = this.translation.instant('CORE.DELETE_NODE.SINGULAR', { name: node.entry.name });
|
||||
|
@@ -118,7 +118,7 @@ export class FolderActionsService {
|
||||
let handlerObservable: Observable<any>;
|
||||
|
||||
if (this.canExecuteAction(node)) {
|
||||
if (this.contentService.hasPermission(node.entry, permission)) {
|
||||
if (this.contentService.hasAllowableOperations(node.entry, permission)) {
|
||||
handlerObservable = this.documentListService.deleteNode(node.entry.id);
|
||||
handlerObservable.subscribe(() => {
|
||||
if (target && typeof target.reload === 'function') {
|
||||
|
Reference in New Issue
Block a user