mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
PublishingQueue.scheduleNewEvent() now includes a permission check to ensure user has 'Add CHild' access to the relevant Channels.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29440 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -26,6 +26,8 @@ import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||
import org.alfresco.repo.transfer.manifest.TransferManifestNodeFactory;
|
||||
import org.alfresco.repo.transfer.manifest.TransferManifestNormalNode;
|
||||
import org.alfresco.service.cmr.publishing.MutablePublishingPackage;
|
||||
@@ -68,7 +70,20 @@ public class MutablePublishingPackageImpl implements MutablePublishingPackage
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public void addNodesToPublish(Collection<NodeRef> nodesToAdd)
|
||||
public void addNodesToPublish(final Collection<NodeRef> nodesToAdd)
|
||||
{
|
||||
AuthenticationUtil.runAs(new RunAsWork<Void>()
|
||||
{
|
||||
public Void doWork() throws Exception
|
||||
{
|
||||
versionNodes(nodesToAdd);
|
||||
return null;
|
||||
}
|
||||
}, AuthenticationUtil.getSystemUserName());
|
||||
nodesToPublish.addAll(nodesToAdd);
|
||||
}
|
||||
|
||||
private void versionNodes(Collection<NodeRef> nodesToAdd)
|
||||
{
|
||||
for (NodeRef nodeRef : nodesToAdd)
|
||||
{
|
||||
@@ -85,7 +100,6 @@ public class MutablePublishingPackageImpl implements MutablePublishingPackage
|
||||
entryMap.put(nodeRef, publishingPackage);
|
||||
}
|
||||
}
|
||||
nodesToPublish.addAll(nodesToAdd);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user