mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged V1.4 to HEAD
svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@3987 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4133 . Removed LicenseComponent reference from projects\repository\source\java\org\alfresco\repo\descriptor\DescriptorServiceImpl.java git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4135 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
*/
|
||||
package org.alfresco.repo.security.permissions.dynamic;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.security.permissions.DynamicAuthority;
|
||||
import org.alfresco.service.cmr.lock.LockService;
|
||||
@@ -44,9 +46,13 @@ public class LockOwnerDynamicAuthority implements DynamicAuthority, Initializing
|
||||
}
|
||||
if (nodeService.hasAspect(nodeRef, ContentModel.ASPECT_WORKING_COPY))
|
||||
{
|
||||
NodeRef original = DefaultTypeConverter.INSTANCE.convert(
|
||||
NodeRef.class, nodeService.getProperty(nodeRef, ContentModel.PROP_COPY_REFERENCE));
|
||||
if (nodeService.exists(original))
|
||||
NodeRef original = null;
|
||||
Serializable reference = nodeService.getProperty(nodeRef, ContentModel.PROP_COPY_REFERENCE);
|
||||
if (reference != null)
|
||||
{
|
||||
original = DefaultTypeConverter.INSTANCE.convert(NodeRef.class, reference);
|
||||
}
|
||||
if (original != null && nodeService.exists(original))
|
||||
{
|
||||
return (lockService.getLockStatus(original) == LockStatus.LOCK_OWNER);
|
||||
}
|
||||
|
@@ -44,7 +44,6 @@ import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author andyh
|
||||
*/
|
||||
|
||||
@@ -153,8 +152,8 @@ public class ACLEntryVoter implements AccessDecisionVoter, InitializingBean
|
||||
if ((attribute.getAttribute() != null)
|
||||
&& (attribute.getAttribute().startsWith(ACL_NODE)
|
||||
|| attribute.getAttribute().startsWith(ACL_PARENT)
|
||||
|| attribute.getAttribute().startsWith(ACL_ALLOW)
|
||||
|| attribute.getAttribute().startsWith(ACL_METHOD)))
|
||||
|| attribute.getAttribute().startsWith(ACL_ALLOW) || attribute.getAttribute().startsWith(
|
||||
ACL_METHOD)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -165,14 +164,11 @@ public class ACLEntryVoter implements AccessDecisionVoter, InitializingBean
|
||||
}
|
||||
|
||||
/**
|
||||
* This implementation supports only <code>MethodSecurityInterceptor</code>,
|
||||
* because it queries the presented <code>MethodInvocation</code>.
|
||||
* This implementation supports only <code>MethodSecurityInterceptor</code>, because it queries the presented <code>MethodInvocation</code>.
|
||||
*
|
||||
* @param clazz
|
||||
* the secure object
|
||||
*
|
||||
* @return <code>true</code> if the secure object is
|
||||
* <code>MethodInvocation</code>, <code>false</code> otherwise
|
||||
* @return <code>true</code> if the secure object is <code>MethodInvocation</code>, <code>false</code> otherwise
|
||||
*/
|
||||
public boolean supports(Class clazz)
|
||||
{
|
||||
@@ -253,7 +249,15 @@ public class ACLEntryVoter implements AccessDecisionVoter, InitializingBean
|
||||
testNodeRef = (NodeRef) invocation.getArguments()[cad.parameter];
|
||||
if (log.isDebugEnabled())
|
||||
{
|
||||
log.debug("\tPermission test on node " + nodeService.getPath(testNodeRef));
|
||||
if (nodeService.exists(testNodeRef))
|
||||
{
|
||||
log.debug("\tPermission test on node " + nodeService.getPath(testNodeRef));
|
||||
}
|
||||
else
|
||||
{
|
||||
log.debug("\tPermission test on non-existing node " +testNodeRef);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else if (ChildAssociationRef.class.isAssignableFrom(params[cad.parameter]))
|
||||
@@ -263,7 +267,14 @@ public class ACLEntryVoter implements AccessDecisionVoter, InitializingBean
|
||||
testNodeRef = ((ChildAssociationRef) invocation.getArguments()[cad.parameter]).getChildRef();
|
||||
if (log.isDebugEnabled())
|
||||
{
|
||||
log.debug("\tPermission test on node " + nodeService.getPath(testNodeRef));
|
||||
if (nodeService.exists(testNodeRef))
|
||||
{
|
||||
log.debug("\tPermission test on node " + nodeService.getPath(testNodeRef));
|
||||
}
|
||||
else
|
||||
{
|
||||
log.debug("\tPermission test on non-existing node " + testNodeRef);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -284,6 +295,14 @@ public class ACLEntryVoter implements AccessDecisionVoter, InitializingBean
|
||||
testNodeRef = nodeService.getPrimaryParent(child).getParentRef();
|
||||
if (log.isDebugEnabled())
|
||||
{
|
||||
if (nodeService.exists(testNodeRef))
|
||||
{
|
||||
log.debug("\tPermission test for parent on node " + nodeService.getPath(testNodeRef));
|
||||
}
|
||||
else
|
||||
{
|
||||
log.debug("\tPermission test for parent on non-existing node " + testNodeRef);
|
||||
}
|
||||
log.debug("\tPermission test for parent on node " + nodeService.getPath(testNodeRef));
|
||||
}
|
||||
}
|
||||
@@ -295,8 +314,17 @@ public class ACLEntryVoter implements AccessDecisionVoter, InitializingBean
|
||||
testNodeRef = ((ChildAssociationRef) invocation.getArguments()[cad.parameter]).getParentRef();
|
||||
if (log.isDebugEnabled())
|
||||
{
|
||||
log.debug("\tPermission test for parent on child assoc ref for node "
|
||||
+ nodeService.getPath(testNodeRef));
|
||||
if (nodeService.exists(testNodeRef))
|
||||
{
|
||||
log.debug("\tPermission test for parent on child assoc ref for node "
|
||||
+ nodeService.getPath(testNodeRef));
|
||||
}
|
||||
else
|
||||
{
|
||||
log.debug("\tPermission test for parent on child assoc ref for non existing node "
|
||||
+ testNodeRef);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user