mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-21 18:09:20 +00:00
Fix ALF-2287: getChangeLog should only be available to admins
- lock down AtomPub and Web Service getContentChanges() git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19697 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -351,6 +351,7 @@
|
|||||||
<property name="fileFolderService" ref="FileFolderService" />
|
<property name="fileFolderService" ref="FileFolderService" />
|
||||||
<property name="searchService" ref="SearchService" />
|
<property name="searchService" ref="SearchService" />
|
||||||
<property name="permissionService" ref="PermissionService" />
|
<property name="permissionService" ref="PermissionService" />
|
||||||
|
<property name="authorityService" ref="AuthorityService" />
|
||||||
|
|
||||||
<property name="propertiesUtil" ref="propertiesUtils" />
|
<property name="propertiesUtil" ref="propertiesUtils" />
|
||||||
</bean>
|
</bean>
|
||||||
|
@@ -33,7 +33,7 @@
|
|||||||
<response type="cmis.atomfeed"/>
|
<response type="cmis.atomfeed"/>
|
||||||
</responses>
|
</responses>
|
||||||
|
|
||||||
<authentication>guest</authentication>
|
<authentication>admin</authentication>
|
||||||
<transaction allow="readonly"/>
|
<transaction allow="readonly"/>
|
||||||
<family>CMIS</family>
|
<family>CMIS</family>
|
||||||
<lifecycle>public_api</lifecycle>
|
<lifecycle>public_api</lifecycle>
|
||||||
|
@@ -65,6 +65,7 @@ import org.alfresco.service.cmr.repository.AssociationRef;
|
|||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.cmr.repository.NodeService;
|
import org.alfresco.service.cmr.repository.NodeService;
|
||||||
import org.alfresco.service.cmr.search.SearchService;
|
import org.alfresco.service.cmr.search.SearchService;
|
||||||
|
import org.alfresco.service.cmr.security.AuthorityService;
|
||||||
import org.alfresco.service.cmr.security.PermissionService;
|
import org.alfresco.service.cmr.security.PermissionService;
|
||||||
import org.alfresco.service.cmr.version.Version;
|
import org.alfresco.service.cmr.version.Version;
|
||||||
import org.alfresco.service.descriptor.DescriptorService;
|
import org.alfresco.service.descriptor.DescriptorService;
|
||||||
@@ -132,6 +133,7 @@ public class DMAbstractServicePort
|
|||||||
protected SearchService searchService;
|
protected SearchService searchService;
|
||||||
protected PropertyUtil propertiesUtil;
|
protected PropertyUtil propertiesUtil;
|
||||||
protected PermissionService permissionService;
|
protected PermissionService permissionService;
|
||||||
|
protected AuthorityService authorityService;
|
||||||
|
|
||||||
public void setCmisService(CMISServices cmisService)
|
public void setCmisService(CMISServices cmisService)
|
||||||
{
|
{
|
||||||
@@ -188,6 +190,11 @@ public class DMAbstractServicePort
|
|||||||
this.permissionService = permissionService;
|
this.permissionService = permissionService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setAuthorityService(AuthorityService authorityService)
|
||||||
|
{
|
||||||
|
this.authorityService = authorityService;
|
||||||
|
}
|
||||||
|
|
||||||
protected PropertyFilter createPropertyFilter(String filter) throws CmisException
|
protected PropertyFilter createPropertyFilter(String filter) throws CmisException
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@@ -40,6 +40,7 @@ import org.alfresco.cmis.CMISResultSetRow;
|
|||||||
import org.alfresco.cmis.CMISServiceException;
|
import org.alfresco.cmis.CMISServiceException;
|
||||||
import org.alfresco.cmis.PropertyFilter;
|
import org.alfresco.cmis.PropertyFilter;
|
||||||
import org.alfresco.repo.cmis.ws.utils.ExceptionUtil;
|
import org.alfresco.repo.cmis.ws.utils.ExceptionUtil;
|
||||||
|
import org.alfresco.repo.security.permissions.AccessDeniedException;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -172,6 +173,11 @@ public class DMDiscoveryServicePort extends DMAbstractServicePort implements Dis
|
|||||||
public void getContentChanges(String repositoryId, Holder<String> changeLogToken, Boolean includeProperties, String filter, Boolean includePolicyIds, Boolean includeACL,
|
public void getContentChanges(String repositoryId, Holder<String> changeLogToken, Boolean includeProperties, String filter, Boolean includePolicyIds, Boolean includeACL,
|
||||||
BigInteger maxItems, CmisExtensionType extension, Holder<CmisObjectListType> objects) throws CmisException
|
BigInteger maxItems, CmisExtensionType extension, Holder<CmisObjectListType> objects) throws CmisException
|
||||||
{
|
{
|
||||||
|
if (!authorityService.hasAdminAuthority())
|
||||||
|
{
|
||||||
|
throw ExceptionUtil.createCmisException("Cannot retrieve content changes", new AccessDeniedException("Requires admin authority"));
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: includePolicyIds
|
// TODO: includePolicyIds
|
||||||
checkRepositoryId(repositoryId);
|
checkRepositoryId(repositoryId);
|
||||||
String changeToken = (null != changeLogToken) ? (changeLogToken.value) : (null);
|
String changeToken = (null != changeLogToken) ? (changeLogToken.value) : (null);
|
||||||
|
Reference in New Issue
Block a user