mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
60016: Merged V4.2-BUG-FIX (4.2.2) to HEAD-BUG-FIX (Cloud/4.3) 59975: MNT-10380: (WebDAV) access denied when attempting to rename file should result in error message. Previously fixed for same issue (was ALF-14398) but lost (most likely during a large merge). git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@62253 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -21,7 +21,6 @@ package org.alfresco.repo.webdav;
|
||||
import static org.junit.Assert.fail;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import static org.mockito.Mockito.never;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
@@ -31,6 +30,7 @@ import java.util.List;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.permissions.AccessDeniedException;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.service.cmr.model.FileFolderService;
|
||||
import org.alfresco.service.cmr.model.FileInfo;
|
||||
@@ -217,6 +217,16 @@ public class MoveMethodTest
|
||||
verify(mockFileFolderService, never()).create(destParentNodeRef, "dest.doc", ContentModel.TYPE_CONTENT);
|
||||
}
|
||||
|
||||
|
||||
@Test(expected=AccessDeniedException.class)
|
||||
public void testMNT_10380_ThrowAccessDeniedExceptionWhenUserLacksPermissions() throws Exception
|
||||
{
|
||||
when(mockFileFolderService.rename(sourceNodeRef, "dest.doc")).
|
||||
thenThrow(new AccessDeniedException("Access denied in test by mockFileFolderService"));
|
||||
|
||||
moveMethod.moveOrCopy(sourceNodeRef, sourceParentNodeRef, destParentNodeRef, "dest.doc");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMNT_9662()
|
||||
{
|
||||
|
Reference in New Issue
Block a user