Merged 5.2.N (5.2.1) to HEAD (5.2)

125767 rmunteanu: Merged 5.1.N (5.1.2) to 5.2.N (5.2.1)
      125473 amorarasu: Merged 5.0.N (5.0.4) to 5.1.N (5.1.2)
         125055 cturlica: Merged V4.2-BUG-FIX (4.2.7) to 5.0.N (5.0.4) (PARTIAL MERGE)
            124999 adragoi: Merged DEV to V4.2-BUG-FIX (4.2.7)
               124402 adragoi: MNT-15368 : Time Consumed for Updating Folder Permission
                  - implemented an approach that uses a separate, asynchronous processes that sets fixed ACL's


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@127794 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-06-03 16:11:08 +00:00
parent b6688d5103
commit c952c8d8b9
14 changed files with 1015 additions and 26 deletions

View File

@@ -34,6 +34,7 @@ import org.alfresco.model.ContentModel;
import org.alfresco.repo.cache.SimpleCache;
import org.alfresco.repo.domain.permissions.AclDAO;
import org.alfresco.repo.node.db.traitextender.NodeServiceTrait;
import org.alfresco.repo.domain.permissions.FixedAclUpdater;
import org.alfresco.repo.policy.JavaBehaviour;
import org.alfresco.repo.policy.PolicyComponent;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
@@ -148,6 +149,8 @@ public class PermissionServiceImpl extends AbstractLifecycleBean implements Perm
protected AclDAO aclDaoComponent;
protected PermissionReference allPermissionReference;
protected FixedAclUpdater fixedAclUpdater;
protected boolean anyDenyDenies = false;
@@ -271,7 +274,12 @@ public class PermissionServiceImpl extends AbstractLifecycleBean implements Perm
{
this.aclDaoComponent = aclDaoComponent;
}
public void setFixedAclUpdater(FixedAclUpdater fixedAclUpdater)
{
this.fixedAclUpdater = fixedAclUpdater;
}
/**
* Set the permissions access cache.
*
@@ -1034,6 +1042,31 @@ public class PermissionServiceImpl extends AbstractLifecycleBean implements Perm
permissionsDaoComponent.setInheritParentPermissions(actualRef, inheritParentPermissions);
accessCache.clear();
}
public void setInheritParentPermissions(NodeRef nodeRef, final boolean inheritParentPermissions, boolean asyncCall)
{
final NodeRef actualRef = tenantService.getName(nodeRef);
if (asyncCall)
{
//use transaction resource to determine later on in ADMAccessControlListDAO.setFixedAcl if asynchronous call may be required
AlfrescoTransactionSupport.bindResource(FixedAclUpdater.FIXED_ACL_ASYNC_CALL_KEY, true);
permissionsDaoComponent.setInheritParentPermissions(actualRef, inheritParentPermissions);
//check if asynchronous call was required
Boolean asyncCallRequired = (Boolean) AlfrescoTransactionSupport.getResource(FixedAclUpdater.FIXED_ACL_ASYNC_REQUIRED_KEY);
if (asyncCallRequired != null && asyncCallRequired)
{
//after transaction is committed FixedAclUpdater will be started in a new thread to process pending nodes
AlfrescoTransactionSupport.bindListener(fixedAclUpdater);
}
}
else
{
//regular method call
permissionsDaoComponent.setInheritParentPermissions(actualRef, inheritParentPermissions);
}
accessCache.clear();
}
/**
* @see org.alfresco.service.cmr.security.PermissionService#getInheritParentPermissions(org.alfresco.service.cmr.repository.NodeRef)

View File

@@ -114,6 +114,12 @@ public class PermissionServiceNOOPImpl implements PermissionServiceSPI
// Do Nothing.
}
@Override
public void setInheritParentPermissions(NodeRef nodeRef, boolean inheritParentPermissions, boolean asyncCall)
{
// Do Nothing.
}
@Override
public boolean getInheritParentPermissions(NodeRef nodeRef)
{