mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-01 14:41:46 +00:00
Compare commits
30 Commits
repo-5439-
...
8.353
Author | SHA1 | Date | |
---|---|---|---|
|
792a86f1ee | ||
|
9d52aa3c64 | ||
|
5e5082d9b3 | ||
|
cb973c4d87 | ||
|
653694b030 | ||
|
f786f4ffaf | ||
|
a79f782a91 | ||
|
3eab59c273 | ||
|
b9adb42c30 | ||
|
9c1bfca7ad | ||
|
a4bf93d33f | ||
|
a74db1443e | ||
|
1600704bee | ||
|
c7d5736f37 | ||
|
3891306459 | ||
|
bf73af71a3 | ||
|
57c04411ed | ||
|
7962cf0b03 | ||
|
eeb49f4b36 | ||
|
31d65ceb42 | ||
|
1b2c5d4c37 | ||
|
c0d1098db0 | ||
|
27af7d2f49 | ||
|
11cf9fa16c | ||
|
5f19aa76af | ||
|
2cffc61164 | ||
|
53c58d4b46 | ||
|
96c6ca844a | ||
|
b3e48b0072 | ||
|
e59c0d7186 |
@@ -33,7 +33,7 @@ stages:
|
||||
- name: test
|
||||
if: commit_message !~ /\[skip tests\]/
|
||||
- name: release
|
||||
if: fork = false AND (branch = master OR branch =~ /release\/.*/ OR branch =~ /fix\/.*/) AND type != pull_request AND commit_message !~ /\[no release\]/
|
||||
if: fork = false AND (branch = master OR branch =~ /release\/.*/) AND type != pull_request AND commit_message !~ /\[no release\]/
|
||||
- name: update_downstream
|
||||
if: fork = false AND (branch = master OR branch =~ /release\/.*/) AND type != pull_request AND commit_message !~ /\[no downstream\]/
|
||||
- name: trigger_downstream
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>repo-5439-M3c1</version>
|
||||
<version>8.353</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@@ -424,12 +424,6 @@ public abstract class AbstractAsynchronouslyRefreshedCache<T>
|
||||
@Override
|
||||
public Void call()
|
||||
{
|
||||
long threadId = Thread.currentThread().getId();
|
||||
logger.debug("Thread # " + threadId + "-> call()");
|
||||
|
||||
logger.debug("Thread # " + threadId + "call()->liveLock.writeLock().lock()");
|
||||
liveLock.writeLock().lock();
|
||||
logger.debug("Thread # " + threadId + "call()->liveLock.writeLock().locked [");
|
||||
try
|
||||
{
|
||||
doCall();
|
||||
@@ -450,12 +444,6 @@ public abstract class AbstractAsynchronouslyRefreshedCache<T>
|
||||
}
|
||||
return null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
logger.debug("Thread # " + threadId + "call()->liveLock.writeLock().unlock()");
|
||||
liveLock.writeLock().unlock();
|
||||
logger.debug("Thread # " + threadId + "call()->liveLock.writeLock().unlocked]");
|
||||
}
|
||||
}
|
||||
|
||||
private void doCall() throws Exception
|
||||
|
@@ -19,6 +19,8 @@
|
||||
package org.alfresco.util.transaction;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
import javax.transaction.HeuristicMixedException;
|
||||
import javax.transaction.HeuristicRollbackException;
|
||||
@@ -135,6 +137,8 @@ public class SpringAwareUserTransaction
|
||||
private long threadId = Long.MIN_VALUE;
|
||||
/** make sure that we clean up the thread transaction stack properly */
|
||||
private boolean finalized = false;
|
||||
|
||||
private Collection<String> labels = Collections.emptyList();
|
||||
|
||||
/**
|
||||
* Creates a user transaction that defaults to {@link TransactionDefinition#PROPAGATION_REQUIRED}.
|
||||
@@ -200,6 +204,21 @@ public class SpringAwareUserTransaction
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Associate one or more labels with this transaction attribute.
|
||||
* <p>This may be used for applying specific transactional behavior
|
||||
* or follow a purely descriptive nature.
|
||||
*/
|
||||
public void setLabels(Collection<String> labels) {
|
||||
this.labels = labels;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> getLabels()
|
||||
{
|
||||
return this.labels;
|
||||
}
|
||||
|
||||
/**
|
||||
* The {@link UserTransaction } must rollback regardless of the error. The
|
||||
* {@link #rollback() rollback} behaviour is implemented by simulating a caught
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>repo-5439-M3c1</version>
|
||||
<version>8.353</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -9,6 +9,6 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>repo-5439-M3c1</version>
|
||||
<version>8.353</version>
|
||||
</parent>
|
||||
</project>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>repo-5439-M3c1</version>
|
||||
<version>8.353</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>repo-5439-M3c1</version>
|
||||
<version>8.353</version>
|
||||
</parent>
|
||||
|
||||
<profiles>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>repo-5439-M3c1</version>
|
||||
<version>8.353</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>repo-5439-M3c1</version>
|
||||
<version>8.353</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>repo-5439-M3c1</version>
|
||||
<version>8.353</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>repo-5439-M3c1</version>
|
||||
<version>8.353</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>repo-5439-M3c1</version>
|
||||
<version>8.353</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>repo-5439-M3c1</version>
|
||||
<version>8.353</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>repo-5439-M3c1</version>
|
||||
<version>8.353</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
24
pom.xml
24
pom.xml
@@ -2,7 +2,7 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>repo-5439-M3c1</version>
|
||||
<version>8.353</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Alfresco Community Repo Parent</name>
|
||||
|
||||
@@ -55,15 +55,15 @@
|
||||
<dependency.alfresco-greenmail.version>6.2</dependency.alfresco-greenmail.version>
|
||||
<dependency.acs-event-model.version>0.0.11</dependency.acs-event-model.version>
|
||||
|
||||
<dependency.spring.version>5.2.9.RELEASE</dependency.spring.version>
|
||||
<dependency.spring.version>5.3.2</dependency.spring.version>
|
||||
<dependency.antlr.version>3.5.2</dependency.antlr.version>
|
||||
<dependency.jackson.version>2.11.3</dependency.jackson.version>
|
||||
<dependency.jackson-databind.version>2.11.2</dependency.jackson-databind.version>
|
||||
<dependency.cxf.version>3.4.1</dependency.cxf.version>
|
||||
<dependency.opencmis.version>1.0.0</dependency.opencmis.version>
|
||||
<dependency.pdfbox.version>2.0.21</dependency.pdfbox.version>
|
||||
<dependency.webscripts.version>8.12</dependency.webscripts.version>
|
||||
<dependency.bouncycastle.version>1.66</dependency.bouncycastle.version>
|
||||
<dependency.webscripts.version>8.15</dependency.webscripts.version>
|
||||
<dependency.bouncycastle.version>1.68</dependency.bouncycastle.version>
|
||||
<dependency.mockito-core.version>3.6.0</dependency.mockito-core.version>
|
||||
<dependency.org-json.version>20200518</dependency.org-json.version>
|
||||
<dependency.commons-dbcp.version>1.4-DBCP330</dependency.commons-dbcp.version>
|
||||
@@ -79,7 +79,7 @@
|
||||
<dependency.jaxb.version>2.3.3</dependency.jaxb.version>
|
||||
<dependency.groovy.version>2.5.9</dependency.groovy.version>
|
||||
<dependency.javax.mail.version>1.6.2</dependency.javax.mail.version>
|
||||
<dependency.tika.version>1.24.1</dependency.tika.version>
|
||||
<dependency.tika.version>1.25</dependency.tika.version>
|
||||
<dependency.spring-security.version>5.4.1</dependency.spring-security.version>
|
||||
<dependency.truezip.version>7.7.10</dependency.truezip.version>
|
||||
<dependency.poi.version>4.1.2</dependency.poi.version>
|
||||
@@ -96,23 +96,23 @@
|
||||
|
||||
<dependency.postgresql.version>42.2.18</dependency.postgresql.version>
|
||||
<dependency.mysql.version>8.0.22</dependency.mysql.version>
|
||||
<dependency.mariadb.version>2.7.0</dependency.mariadb.version>
|
||||
<dependency.tas-utility.version>3.0.40</dependency.tas-utility.version>
|
||||
<dependency.mariadb.version>2.7.1</dependency.mariadb.version>
|
||||
<dependency.tas-utility.version>3.0.41</dependency.tas-utility.version>
|
||||
<dependency.rest-assured.version>3.3.0</dependency.rest-assured.version>
|
||||
<dependency.javax.json.version>1.1.4</dependency.javax.json.version>
|
||||
<dependency.tas-restapi.version>1.48</dependency.tas-restapi.version>
|
||||
<dependency.tas-cmis.version>1.21</dependency.tas-cmis.version>
|
||||
<dependency.tas-restapi.version>1.50</dependency.tas-restapi.version>
|
||||
<dependency.tas-cmis.version>1.25</dependency.tas-cmis.version>
|
||||
<dependency.tas-email.version>1.8</dependency.tas-email.version>
|
||||
<dependency.tas-webdav.version>1.6</dependency.tas-webdav.version>
|
||||
<dependency.tas-ftp.version>1.5</dependency.tas-ftp.version>
|
||||
<dependency.tas-dataprep.version>2.3</dependency.tas-dataprep.version>
|
||||
<dependency.tas-dataprep.version>2.6</dependency.tas-dataprep.version>
|
||||
</properties>
|
||||
|
||||
<scm>
|
||||
<connection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</connection>
|
||||
<developerConnection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</developerConnection>
|
||||
<url>https://github.com/Alfresco/alfresco-community-repo</url>
|
||||
<tag>repo-5439-M3c1</tag>
|
||||
<tag>8.353</tag>
|
||||
</scm>
|
||||
|
||||
<distributionManagement>
|
||||
@@ -474,7 +474,7 @@
|
||||
<dependency>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>bcprov-jdk15on</artifactId>
|
||||
<version>1.67</version>
|
||||
<version>1.68</version>
|
||||
<!-- <version>${dependency.bouncycastle.version}</version>-->
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>repo-5439-M3c1</version>
|
||||
<version>8.353</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@@ -243,7 +243,7 @@ public class QuickShareRestApiTest extends BaseWebScriptTest
|
||||
// get content thumbnail for node (authenticated)
|
||||
rsp = sendRequest(new GetRequest(AUTH_CONTENT_THUMBNAIL_URL.replace("{node_ref_3}", testNodeRef_3).replace("{thumbnailname}", "doclib")), expectedStatusOK, USER_ONE);
|
||||
String type = rsp.getContentType();
|
||||
assertEquals(TEST_MIMETYPE_PNG, type);
|
||||
assertEquals(TEST_MIMETYPE_PNG + ";charset=UTF-8", type);
|
||||
|
||||
// As user two ...
|
||||
|
||||
@@ -279,7 +279,7 @@ public class QuickShareRestApiTest extends BaseWebScriptTest
|
||||
// get content thumbnail for share (note: can be unauthenticated)
|
||||
rsp = sendRequest(new GetRequest(SHARE_CONTENT_THUMBNAIL_URL.replace("{shared_id}", sharedId).replace("{thumbnailname}", "doclib")), expectedStatusOK, USER_TWO);
|
||||
type = rsp.getContentType();
|
||||
assertEquals(TEST_MIMETYPE_PNG, type);
|
||||
assertEquals(TEST_MIMETYPE_PNG + ";charset=UTF-8", type);
|
||||
|
||||
// As user one ...
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>repo-5439-M3c1</version>
|
||||
<version>8.353</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
@@ -986,7 +986,7 @@
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-all</artifactId>
|
||||
<version>2.4.20</version>
|
||||
<version>2.4.21</version>
|
||||
<classifier>indy</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.repo.domain.permissions;
|
||||
package org.alfresco.repo.domain.permissions;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
@@ -392,8 +392,20 @@ public class ADMAccessControlListDAO implements AccessControlListDAO
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
else
|
||||
{
|
||||
// When node is copied when the aspect is applied, the sharedACLtoReplace will not match the children's ACLS
|
||||
// to replace, we need to use the current one.
|
||||
Long currentAcl = nodeDAO.getNodeAclId(nodeId);
|
||||
|
||||
if (nodeDAO.hasNodeAspect(nodeId, ContentModel.ASPECT_PENDING_FIX_ACL))
|
||||
{
|
||||
// If node has a pending acl, retrieve the sharedAclToReplace from node property. When the job calls
|
||||
// this, it already does it but on move and copy operations, it uses the new parents old ACL.
|
||||
sharedAclToReplace = (Long) nodeDAO.getNodeProperty(nodeId, ContentModel.PROP_SHARED_ACL_TO_REPLACE);
|
||||
|
||||
}
|
||||
|
||||
// Lazily retrieve/create the shared ACL
|
||||
if (mergeFrom == null)
|
||||
{
|
||||
@@ -405,33 +417,26 @@ public class ADMAccessControlListDAO implements AccessControlListDAO
|
||||
nodeDAO.setNodeAclId(nodeId, mergeFrom);
|
||||
}
|
||||
|
||||
List<NodeIdAndAclId> children = nodeDAO.getPrimaryChildrenAcls(nodeId);
|
||||
|
||||
if(children.size() > 0)
|
||||
{
|
||||
nodeDAO.setPrimaryChildrenSharedAclId(nodeId, sharedAclToReplace, mergeFrom);
|
||||
}
|
||||
List<NodeIdAndAclId> children = nodeDAO.getPrimaryChildrenAcls(nodeId);
|
||||
|
||||
if (!propagateOnChildren)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (NodeIdAndAclId child : children)
|
||||
{
|
||||
Long acl = child.getAclId();
|
||||
|
||||
{
|
||||
//Use the current ACL instead of the stored value, it could've been changed meanwhile
|
||||
Long acl = nodeDAO.getNodeAclId(child.getId());
|
||||
|
||||
if (acl == null)
|
||||
{
|
||||
propagateOnChildren = setFixAclPending(child.getId(), inheritFrom, mergeFrom, sharedAclToReplace, changes, false, asyncCall, propagateOnChildren);
|
||||
}
|
||||
else
|
||||
{
|
||||
// if(acl.equals(mergeFrom))
|
||||
// {
|
||||
// setFixedAcls(child.getId(), inheritFrom, mergeFrom, sharedAclToReplace, changes, false);
|
||||
// }
|
||||
// Still has old shared ACL or already replaced
|
||||
if(acl.equals(sharedAclToReplace) || acl.equals(mergeFrom))
|
||||
if(acl.equals(sharedAclToReplace) || acl.equals(mergeFrom) || acl.equals(currentAcl))
|
||||
{
|
||||
propagateOnChildren = setFixAclPending(child.getId(), inheritFrom, mergeFrom, sharedAclToReplace, changes, false, asyncCall, propagateOnChildren);
|
||||
}
|
||||
@@ -456,7 +461,22 @@ public class ADMAccessControlListDAO implements AccessControlListDAO
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// By doing an eager update of the direct children we canot see if another thread has changed the ACL
|
||||
// between the time we get the child nodes and we update them. By updating the direct children last it is
|
||||
// possible to verify if any child has changed meanwhile.
|
||||
if(children.size() > 0)
|
||||
{
|
||||
nodeDAO.setPrimaryChildrenSharedAclId(nodeId, sharedAclToReplace, mergeFrom);
|
||||
}
|
||||
|
||||
// When this is not executed triggered by the job, but a move or copy operation occures on a pending
|
||||
// node, we don't want to apply the OLD ACL that was pending
|
||||
if(nodeDAO.hasNodeAspect(nodeId, ContentModel.ASPECT_PENDING_FIX_ACL))
|
||||
{
|
||||
removePendingAclAspect(nodeId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -509,25 +529,45 @@ public class ADMAccessControlListDAO implements AccessControlListDAO
|
||||
}
|
||||
// set ASPECT_PENDING_FIX_ACL aspect on node to be later on processed with FixedAclUpdater amd switch flag
|
||||
// FIXED_ACL_ASYNC_REQUIRED_KEY
|
||||
addFixedAclPendingAspect(nodeId, sharedAclToReplace, inheritFrom);
|
||||
addFixedAclPendingAspect(nodeId, sharedAclToReplace, inheritFrom, mergeFrom);
|
||||
AlfrescoTransactionSupport.bindResource(FixedAclUpdater.FIXED_ACL_ASYNC_REQUIRED_KEY, true);
|
||||
// stop propagating on children nodes
|
||||
return false;
|
||||
}
|
||||
|
||||
private void addFixedAclPendingAspect(Long nodeId, Long sharedAclToReplace, Long inheritFrom)
|
||||
{
|
||||
Set<QName> aspect = new HashSet<>();
|
||||
aspect.add(ContentModel.ASPECT_PENDING_FIX_ACL);
|
||||
nodeDAO.addNodeAspects(nodeId, aspect);
|
||||
Map<QName, Serializable> pendingAclProperties = new HashMap<>();
|
||||
pendingAclProperties.put(ContentModel.PROP_SHARED_ACL_TO_REPLACE, sharedAclToReplace);
|
||||
pendingAclProperties.put(ContentModel.PROP_INHERIT_FROM_ACL, inheritFrom);
|
||||
nodeDAO.addNodeProperties(nodeId, pendingAclProperties);
|
||||
if (log.isDebugEnabled())
|
||||
{
|
||||
log.debug("Set Fixed Acl Pending : " + nodeId + " " + nodeDAO.getNodePair(nodeId).getSecond());
|
||||
private void addFixedAclPendingAspect(Long nodeId, Long sharedAclToReplace, Long inheritFrom, Long mergeFrom)
|
||||
{
|
||||
//If the node already has the pending ACL aspect, just update the new inheritFrom value
|
||||
if (nodeDAO.hasNodeAspect(nodeId, ContentModel.ASPECT_PENDING_FIX_ACL))
|
||||
{
|
||||
Map<QName, Serializable> pendingAclProperties = new HashMap<>();
|
||||
pendingAclProperties.put(ContentModel.PROP_INHERIT_FROM_ACL, inheritFrom);
|
||||
nodeDAO.addNodeProperties(nodeId, pendingAclProperties);
|
||||
return;
|
||||
}
|
||||
|
||||
Set<QName> aspect = new HashSet<>();
|
||||
aspect.add(ContentModel.ASPECT_PENDING_FIX_ACL);
|
||||
nodeDAO.addNodeAspects(nodeId, aspect);
|
||||
Map<QName, Serializable> pendingAclProperties = new HashMap<>();
|
||||
pendingAclProperties.put(ContentModel.PROP_SHARED_ACL_TO_REPLACE, sharedAclToReplace);
|
||||
pendingAclProperties.put(ContentModel.PROP_INHERIT_FROM_ACL, inheritFrom);
|
||||
nodeDAO.addNodeProperties(nodeId, pendingAclProperties);
|
||||
if (log.isDebugEnabled())
|
||||
{
|
||||
log.debug("Set Fixed Acl Pending : " + nodeId + " " + nodeDAO.getNodePair(nodeId).getSecond());
|
||||
}
|
||||
}
|
||||
|
||||
public void removePendingAclAspect(Long nodeId)
|
||||
{
|
||||
Set<QName> aspects = new HashSet<>(1);
|
||||
aspects.add(ContentModel.ASPECT_PENDING_FIX_ACL);
|
||||
Set<QName> pendingFixAclProperties = new HashSet<>();
|
||||
pendingFixAclProperties.add(ContentModel.PROP_SHARED_ACL_TO_REPLACE);
|
||||
pendingFixAclProperties.add(ContentModel.PROP_INHERIT_FROM_ACL);
|
||||
nodeDAO.removeNodeAspects(nodeId, aspects);
|
||||
nodeDAO.removeNodeProperties(nodeId, pendingFixAclProperties);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -105,5 +105,7 @@ public interface AccessControlListDAO
|
||||
|
||||
public void updateInheritance(Long childNodeId, Long oldParentAclId, Long newParentAclId);
|
||||
|
||||
public void setFixedAcls(Long nodeId, Long inheritFrom, Long mergeFrom, Long sharedAclToReplace, List<AclChange> changes, boolean set);
|
||||
public void setFixedAcls(Long nodeId, Long inheritFrom, Long mergeFrom, Long sharedAclToReplace, List<AclChange> changes, boolean set);
|
||||
|
||||
public void removePendingAclAspect(Long nodeId);
|
||||
}
|
||||
|
@@ -53,7 +53,6 @@ import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.repo.transaction.TransactionListenerAdapter;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef.Status;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
@@ -93,8 +92,8 @@ public class FixedAclUpdater extends TransactionListenerAdapter implements Appli
|
||||
private int maxItemBatchSize = 100;
|
||||
private int numThreads = 4;
|
||||
|
||||
private ClassPolicyDelegate<OnInheritPermissionsDisabled> onInheritPermissionsDisabledDelegate;
|
||||
private PolicyComponent policyComponent;
|
||||
private ClassPolicyDelegate<OnInheritPermissionsDisabled> onInheritPermissionsDisabledDelegate;
|
||||
private PolicyComponent policyComponent;
|
||||
private PolicyIgnoreUtil policyIgnoreUtil;
|
||||
|
||||
public void setNumThreads(int numThreads)
|
||||
@@ -137,8 +136,8 @@ public class FixedAclUpdater extends TransactionListenerAdapter implements Appli
|
||||
{
|
||||
this.lockTimeToLive = lockTimeToLive;
|
||||
this.lockRefreshTime = lockTimeToLive / 2;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setPolicyComponent(PolicyComponent policyComponent)
|
||||
{
|
||||
this.policyComponent = policyComponent;
|
||||
@@ -151,7 +150,8 @@ public class FixedAclUpdater extends TransactionListenerAdapter implements Appli
|
||||
|
||||
public void init()
|
||||
{
|
||||
onInheritPermissionsDisabledDelegate = policyComponent.registerClassPolicy(PermissionServicePolicies.OnInheritPermissionsDisabled.class);
|
||||
onInheritPermissionsDisabledDelegate = policyComponent
|
||||
.registerClassPolicy(PermissionServicePolicies.OnInheritPermissionsDisabled.class);
|
||||
}
|
||||
|
||||
private class GetNodesWithAspects
|
||||
@@ -264,35 +264,34 @@ public class FixedAclUpdater extends TransactionListenerAdapter implements Appli
|
||||
{
|
||||
log.debug(String.format("Processing node %s", nodeRef));
|
||||
}
|
||||
|
||||
final Long nodeId = nodeDAO.getNodePair(nodeRef).getFirst();
|
||||
|
||||
// MNT-22009 - If node was deleted and in archive store, remove the aspect and properties and do not
|
||||
// process
|
||||
if (nodeRef.getStoreRef().equals(StoreRef.STORE_REF_ARCHIVE_SPACESSTORE))
|
||||
{
|
||||
nodeDAO.removeNodeAspects(nodeId, aspects);
|
||||
nodeDAO.removeNodeProperties(nodeId, PENDING_FIX_ACL_ASPECT_PROPS);
|
||||
accessControlListDAO.removePendingAclAspect(nodeId);
|
||||
return null;
|
||||
}
|
||||
|
||||
// retrieve acl properties from node
|
||||
Long inheritFrom = (Long) nodeDAO.getNodeProperty(nodeId,
|
||||
ContentModel.PROP_INHERIT_FROM_ACL);
|
||||
Long sharedAclToReplace = (Long) nodeDAO.getNodeProperty(nodeId,
|
||||
ContentModel.PROP_SHARED_ACL_TO_REPLACE);
|
||||
Long inheritFrom = (Long) nodeDAO.getNodeProperty(nodeId, ContentModel.PROP_INHERIT_FROM_ACL);
|
||||
Long sharedAclToReplace = (Long) nodeDAO.getNodeProperty(nodeId, ContentModel.PROP_SHARED_ACL_TO_REPLACE);
|
||||
|
||||
// set inheritance using retrieved prop
|
||||
accessControlListDAO.setInheritanceForChildren(nodeRef, inheritFrom, sharedAclToReplace,
|
||||
true);
|
||||
accessControlListDAO.setInheritanceForChildren(nodeRef, inheritFrom, sharedAclToReplace, true);
|
||||
|
||||
// Remove aspect
|
||||
accessControlListDAO.removePendingAclAspect(nodeId);
|
||||
|
||||
nodeDAO.removeNodeAspects(nodeId, aspects);
|
||||
nodeDAO.removeNodeProperties(nodeId, PENDING_FIX_ACL_ASPECT_PROPS);
|
||||
|
||||
if (!policyIgnoreUtil.ignorePolicy(nodeRef))
|
||||
{
|
||||
boolean transformedToAsyncOperation = toBoolean((Boolean) AlfrescoTransactionSupport.getResource(FixedAclUpdater.FIXED_ACL_ASYNC_REQUIRED_KEY));
|
||||
boolean transformedToAsyncOperation = toBoolean(
|
||||
(Boolean) AlfrescoTransactionSupport.getResource(FixedAclUpdater.FIXED_ACL_ASYNC_REQUIRED_KEY));
|
||||
|
||||
OnInheritPermissionsDisabled onInheritPermissionsDisabledPolicy = onInheritPermissionsDisabledDelegate.get(ContentModel.TYPE_BASE);
|
||||
OnInheritPermissionsDisabled onInheritPermissionsDisabledPolicy = onInheritPermissionsDisabledDelegate
|
||||
.get(ContentModel.TYPE_BASE);
|
||||
onInheritPermissionsDisabledPolicy.onInheritPermissionsDisabled(nodeRef, transformedToAsyncOperation);
|
||||
}
|
||||
|
||||
@@ -406,12 +405,8 @@ public class FixedAclUpdater extends TransactionListenerAdapter implements Appli
|
||||
|
||||
AclWorkProvider provider = new AclWorkProvider();
|
||||
AclWorker worker = new AclWorker();
|
||||
BatchProcessor<NodeRef> bp = new BatchProcessor<>(
|
||||
"FixedAclUpdater",
|
||||
transactionService.getRetryingTransactionHelper(),
|
||||
provider,
|
||||
numThreads, maxItemBatchSize,
|
||||
applicationContext,
|
||||
BatchProcessor<NodeRef> bp = new BatchProcessor<>("FixedAclUpdater",
|
||||
transactionService.getRetryingTransactionHelper(), provider, numThreads, maxItemBatchSize, applicationContext,
|
||||
log, 100);
|
||||
int count = bp.process(worker, true);
|
||||
return count;
|
||||
@@ -424,7 +419,7 @@ public class FixedAclUpdater extends TransactionListenerAdapter implements Appli
|
||||
finally
|
||||
{
|
||||
jobLockRefreshCallback.isActive.set(false);
|
||||
if(lockToken != null)
|
||||
if (lockToken != null)
|
||||
{
|
||||
jobLockService.releaseLock(lockToken, lockQName);
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -39,9 +39,7 @@ import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.GUID;
|
||||
import org.alfresco.util.testing.category.IntermittentlyFailingTests;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
/**
|
||||
* @author Adina Ababei
|
||||
@@ -348,7 +346,6 @@ public class ChildAssociationRepoEventIT extends AbstractContextAwareRepoEvent
|
||||
assertEquals("cm:contains", getChildAssocResource(childAssocEvents.get(2)).getAssocType());
|
||||
}
|
||||
|
||||
@Category(IntermittentlyFailingTests.class) // ACS-959
|
||||
@Test
|
||||
public void testOneParentMultipleChildrenSameTransaction()
|
||||
{
|
||||
@@ -389,6 +386,7 @@ public class ChildAssociationRepoEventIT extends AbstractContextAwareRepoEvent
|
||||
return null;
|
||||
});
|
||||
|
||||
checkNumOfEvents(7);
|
||||
// 3 assoc.child.Created events should be created
|
||||
List<RepoEvent<EventData<ChildAssociationResource>>> childAssocEvents = getFilteredEvents(EventType.CHILD_ASSOC_CREATED);
|
||||
assertEquals("Wrong association events number",3, childAssocEvents.size());
|
||||
|
@@ -29,8 +29,6 @@ import javax.transaction.RollbackException;
|
||||
import javax.transaction.Status;
|
||||
import javax.transaction.UserTransaction;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.domain.dialect.Dialect;
|
||||
import org.alfresco.repo.domain.dialect.PostgreSQLDialect;
|
||||
@@ -45,17 +43,12 @@ import org.alfresco.service.cmr.security.PersonService;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.service.transaction.ReadOnlyServerException;
|
||||
import org.alfresco.test_category.OwnJVMTestsCategory;
|
||||
import org.alfresco.util.ApplicationContextHelper;
|
||||
import org.alfresco.util.BaseSpringTest;
|
||||
import org.alfresco.util.PropertyMap;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.dao.InvalidDataAccessApiUsageException;
|
||||
import org.springframework.dao.TransientDataAccessResourceException;
|
||||
import org.springframework.jdbc.UncategorizedSQLException;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
|
||||
/**
|
||||
@@ -192,7 +185,7 @@ public class TransactionServiceImplTest extends BaseSpringTest
|
||||
@SuppressWarnings("unused")
|
||||
int i = 0;
|
||||
}
|
||||
catch (UncategorizedSQLException e)
|
||||
catch (Exception e)
|
||||
{
|
||||
// or this - for PostgreSQL (org.postgresql.util.PSQLException: ERROR: transaction is read-only)
|
||||
if (dialect instanceof PostgreSQLDialect)
|
||||
|
@@ -14,7 +14,6 @@ git config user.email "${GIT_EMAIL}"
|
||||
mvn -B \
|
||||
-PfullBuild,all-tas-tests \
|
||||
"-Darguments=-PfullBuild,all-tas-tests -DskipTests -Dbuild-number=${TRAVIS_BUILD_NUMBER}" \
|
||||
-DreleaseVersion=repo-5439-M3c1 -DdevelopmentVersion=8.346-M3-SNAPSHOT \
|
||||
release:clean release:prepare release:perform \
|
||||
-DscmCommentPrefix="[maven-release-plugin][skip ci] " \
|
||||
-Dusername="${GIT_USERNAME}" \
|
||||
|
Reference in New Issue
Block a user