mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
RM-2270: WIP: Extending QuickShareService to prevent classified content being shared. Checking in for +review @taksoy @tpage @rweatherall @nmcerlean
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@105022 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -26,6 +26,17 @@
|
||||
<property name="extendingBeanName" value="rm.FileFolderService_security" />
|
||||
</bean>
|
||||
|
||||
<!-- Commented out due to startup error relating to proxyInterface-->
|
||||
<!-- extended QuickShare bean definition -->
|
||||
<!--<bean id="rm.QuickShareService" abstract="true"-->
|
||||
<!--class="org.alfresco.repo.quickshare.ExtendedQuickShareServiceImpl">-->
|
||||
<!--<property name="nodeService" ref="NodeService"/>-->
|
||||
<!--</bean>-->
|
||||
<!--<bean class="org.alfresco.util.BeanExtender">-->
|
||||
<!--<property name="beanName" value="QuickShareService"/>-->
|
||||
<!--<property name="extendingBeanName" value="rm.QuickShareService"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<bean id="ExtendedPermissionService" class="org.springframework.aop.framework.ProxyFactoryBean">
|
||||
<property name="proxyInterfaces">
|
||||
<value>org.alfresco.repo.security.permissions.impl.ExtendedPermissionService</value>
|
||||
|
@@ -0,0 +1,43 @@
|
||||
package org.alfresco.repo.quickshare;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationLevelManager;
|
||||
import org.alfresco.module.org_alfresco_module_rm.classification.model.ClassifiedContentModel;
|
||||
import org.alfresco.service.cmr.quickshare.QuickShareDTO;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
|
||||
/**
|
||||
* Extend the QuickShareService to check that content isn't classified before sharing it.
|
||||
*
|
||||
* @author David Webster
|
||||
*/
|
||||
public class ExtendedQuickShareServiceImpl extends QuickShareServiceImpl
|
||||
{
|
||||
private NodeService nodeService;
|
||||
|
||||
/**
|
||||
* Set node service locally as inherited instance is private.
|
||||
*
|
||||
* @param nodeService the nodeService used to check node props and aspects
|
||||
*/
|
||||
@Override
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
super.setNodeService(nodeService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QuickShareDTO shareContent(final NodeRef nodeRef)
|
||||
{
|
||||
if (!nodeService.hasAspect(nodeRef, ClassifiedContentModel.ASPECT_CLASSIFIED) || nodeService.getProperty(nodeRef, ClassifiedContentModel.PROP_CURRENT_CLASSIFICATION)
|
||||
.equals(ClassificationLevelManager.UNCLASSIFIED_ID))
|
||||
{
|
||||
return super.shareContent(nodeRef);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalStateException("Unable to share classified content");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user