From bdfadabda753b100df12cc03f75dbcb482d65d23 Mon Sep 17 00:00:00 2001 From: Mark Rogers Date: Mon, 21 Nov 2011 09:56:49 +0000 Subject: [PATCH] ALF-10902 - No friendly notification occurs when Editor or Collaborator tries to delete content git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@32131 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../filesys/repo/ContentDiskDriver2.java | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/source/java/org/alfresco/filesys/repo/ContentDiskDriver2.java b/source/java/org/alfresco/filesys/repo/ContentDiskDriver2.java index 9a9057c3f9..39e8f3b036 100644 --- a/source/java/org/alfresco/filesys/repo/ContentDiskDriver2.java +++ b/source/java/org/alfresco/filesys/repo/ContentDiskDriver2.java @@ -153,7 +153,6 @@ public class ContentDiskDriver2 extends AlfrescoDiskDriver implements ExtendedD public void init() { PropertyCheck.mandatory(this, "checkOutCheckInService", checkOutCheckInService); -// PropertyCheck.mandatory(this, "shuffleCache", shuffleCache); PropertyCheck.mandatory(this, "cifsHelper", cifsHelper); PropertyCheck.mandatory(this, "namespaceService", namespaceService); PropertyCheck.mandatory(this, "nodeService", nodeService); @@ -1866,6 +1865,10 @@ public class ContentDiskDriver2 extends AlfrescoDiskDriver implements ExtendedD if ( permissionService.hasPermission(nodeRef, PermissionService.WRITE) == AccessStatus.DENIED) { + if(logger.isDebugEnabled()) + { + logger.debug("write access denied to : + name"); + } throw new AccessDeniedException("No write access to " + name); } @@ -1875,6 +1878,16 @@ public class ContentDiskDriver2 extends AlfrescoDiskDriver implements ExtendedD // Check if the file is being marked for deletion, if so then check if the file is locked if ( info.hasSetFlag(FileInfo.SetDeleteOnClose) && info.hasDeleteOnClose()) { + if(logger.isDebugEnabled()) + { + logger.debug("delete access denied to : + name"); + } + // Check for delete permission + if ( permissionService.hasPermission(nodeRef, PermissionService.DELETE) == AccessStatus.DENIED) + { + throw new AccessDeniedException("No delete access to " + name); + } + // Check if the node is locked lockService.checkForLock(nodeRef); @@ -2599,11 +2612,7 @@ public class ContentDiskDriver2 extends AlfrescoDiskDriver implements ExtendedD NodeRef nodeRef = cifsHelper.createNode(dirNodeRef, folderName, ContentModel.TYPE_CONTENT); nodeService.addAspect(nodeRef, ContentModel.ASPECT_NO_CONTENT, null); - - // Create the network file - -// ContentNetworkFile netFile = ContentNetworkFile.createFile(nodeService, contentService, mimetypeService, getCifsHelper(), nodeRef, params, sess); - + File file = TempFileProvider.createTempFile("cifs", ".bin"); TempNetworkFile netFile = new TempNetworkFile(file, path); @@ -2898,7 +2907,6 @@ public class ContentDiskDriver2 extends AlfrescoDiskDriver implements ExtendedD } } - @Override public OpLockManager getOpLockManager(SrvSession sess, TreeConnection tree) {