Merged 5.0.N (5.0.4) to 5.1.N (5.1.1)

122101 cturlica: Merged V4.2-BUG-FIX (4.2.7) to 5.0.N (5.0.4)
      122078 amukha: MNT-15654: Un-sharing updates the modified properties of a file
         - Disabled audit during unshare.
         - Added JUnit test.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@122216 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ramona Neamtu
2016-02-15 14:00:52 +00:00
parent 1ab5f95983
commit eb7bc51e00
2 changed files with 47 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2014 Alfresco Software Limited.
* Copyright (C) 2005-2016 Alfresco Software Limited.
*
* This file is part of Alfresco
*
@@ -431,5 +431,36 @@ public class QuickShareServiceIntegrationTest
}
});
}
/**
* Test for MNT-15654
* <p> The node is created and shared by user1. Then unshared by user2
* <p> The modifier should not change to user2 after unsharing.
*/
@Test
public void testModifierAfterUnSharing()
{
AuthenticationUtil.runAs(new RunAsWork<Void>(){
@Override
public Void doWork() throws Exception
{
permissionService.setPermission(testNode, user2.getUsername(), PermissionService.CONSUMER, true);
return null;
}
}, user1.getUsername());
QuickShareDTO dto = share(testNode, user1.getUsername());
unshare(dto.getId(), user2.getUsername());
String modifier = AuthenticationUtil.runAsSystem(new RunAsWork<String>(){
@Override
public String doWork() throws Exception
{
return (String )nodeService.getProperty(testNode, ContentModel.PROP_MODIFIER);
}
});
assertEquals("The modifier has changed after sharing.", user1.getUsername(), modifier);
}
}