mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fix ALF-1017 specific test following ALF-1017 changes to permissions
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30692 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -41,6 +41,7 @@ import org.alfresco.repo.management.subsystems.ChildApplicationContextFactory;
|
|||||||
import org.alfresco.repo.node.archive.NodeArchiveService;
|
import org.alfresco.repo.node.archive.NodeArchiveService;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||||
|
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||||
import org.alfresco.repo.security.authority.UnknownAuthorityException;
|
import org.alfresco.repo.security.authority.UnknownAuthorityException;
|
||||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||||
import org.alfresco.service.cmr.dictionary.TypeDefinition;
|
import org.alfresco.service.cmr.dictionary.TypeDefinition;
|
||||||
@@ -1915,15 +1916,25 @@ public class SiteServiceImplTest extends BaseAlfrescoSpringTest
|
|||||||
assertEquals(preexistingSitesCount+2, sites.size());
|
assertEquals(preexistingSitesCount+2, sites.size());
|
||||||
|
|
||||||
// Now add a random folder, and a random document to the sites root
|
// Now add a random folder, and a random document to the sites root
|
||||||
NodeRef sitesSpace = this.nodeService.getPrimaryParent(site1.getNodeRef()).getParentRef();
|
final NodeRef sitesSpace = this.nodeService.getPrimaryParent(site1.getNodeRef()).getParentRef();
|
||||||
NodeRef folder = this.nodeService.createNode(
|
final NodeRef folder = AuthenticationUtil.runAsSystem(new RunAsWork<NodeRef>() {
|
||||||
sitesSpace, ContentModel.ASSOC_CONTAINS,
|
@Override
|
||||||
QName.createQName("Folder"), ContentModel.TYPE_FOLDER
|
public NodeRef doWork() throws Exception {
|
||||||
).getChildRef();
|
return nodeService.createNode(
|
||||||
NodeRef document = this.nodeService.createNode(
|
sitesSpace, ContentModel.ASSOC_CONTAINS,
|
||||||
sitesSpace, ContentModel.ASSOC_CONTAINS,
|
QName.createQName("Folder"), ContentModel.TYPE_FOLDER
|
||||||
QName.createQName("Document"), ContentModel.TYPE_CONTENT
|
).getChildRef();
|
||||||
).getChildRef();
|
}
|
||||||
|
});
|
||||||
|
final NodeRef document = AuthenticationUtil.runAsSystem(new RunAsWork<NodeRef>() {
|
||||||
|
@Override
|
||||||
|
public NodeRef doWork() throws Exception {
|
||||||
|
return nodeService.createNode(
|
||||||
|
sitesSpace, ContentModel.ASSOC_CONTAINS,
|
||||||
|
QName.createQName("Document"), ContentModel.TYPE_CONTENT
|
||||||
|
).getChildRef();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Listing should still be fine, and count won't have increased
|
// Listing should still be fine, and count won't have increased
|
||||||
sites = this.siteService.listSites(null, null);
|
sites = this.siteService.listSites(null, null);
|
||||||
|
Reference in New Issue
Block a user