mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Fix for ALF-16836 CMIS isImmutable is not shown correctly
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@43683 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -23,6 +23,9 @@ import java.io.Serializable;
|
||||
import org.alfresco.opencmis.CMISConnector;
|
||||
import org.alfresco.opencmis.dictionary.CMISNodeInfo;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.lock.LockService;
|
||||
import org.alfresco.service.cmr.lock.LockType;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.apache.chemistry.opencmis.commons.PropertyIds;
|
||||
|
||||
/**
|
||||
@@ -32,18 +35,22 @@ import org.apache.chemistry.opencmis.commons.PropertyIds;
|
||||
*/
|
||||
public class IsImmutableProperty extends AbstractProperty
|
||||
{
|
||||
private LockService lockService;
|
||||
|
||||
/**
|
||||
* Construct
|
||||
*/
|
||||
public IsImmutableProperty(ServiceRegistry serviceRegistry, CMISConnector connector)
|
||||
{
|
||||
super(serviceRegistry, connector, PropertyIds.IS_IMMUTABLE);
|
||||
lockService = serviceRegistry.getLockService();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Serializable getValueInternal(CMISNodeInfo nodeInfo)
|
||||
{
|
||||
if (nodeInfo.isVersion())
|
||||
NodeRef nodeRef = nodeInfo.getNodeRef();
|
||||
if (nodeInfo.isVersion() || (nodeInfo.hasPWC() && !nodeInfo.isPWC()) || (lockService.getLockType(nodeRef) == LockType.READ_ONLY_LOCK))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user