diff --git a/.gitignore b/.gitignore
index 5cd20fa5aa..ff04b28cf1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,3 +32,6 @@ target
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
+alf_data
+/src/main/resources/alfresco-global.properties
+/src/main/resources/alfresco/extension/custom-log4j.properties
diff --git a/pom.xml b/pom.xml
index 9bfa10ac3b..9b8e0e8dff 100644
--- a/pom.xml
+++ b/pom.xml
@@ -40,7 +40,7 @@
6.0
6.13
6.0
- 6.17
+ 6.18
6.3
1.0
diff --git a/src/main/java/org/alfresco/opencmis/AlfrescoCmisServiceImpl.java b/src/main/java/org/alfresco/opencmis/AlfrescoCmisServiceImpl.java
index 0e01b2d199..6da2629133 100644
--- a/src/main/java/org/alfresco/opencmis/AlfrescoCmisServiceImpl.java
+++ b/src/main/java/org/alfresco/opencmis/AlfrescoCmisServiceImpl.java
@@ -1283,11 +1283,6 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr
throw new CmisConstraintException("This document type does requires content!");
}
- if (docType.isVersionable() && (versioningState == VersioningState.NONE))
- {
- throw new CmisConstraintException("This document type is versionable!");
- }
-
if (!docType.isVersionable() && (versioningState != VersioningState.NONE))
{
throw new CmisConstraintException("This document type is not versionable!");
diff --git a/src/main/java/org/alfresco/repo/site/SitesPermissionCleaner.java b/src/main/java/org/alfresco/repo/site/SitesPermissionCleaner.java
index 76d37475d3..9c655b43a7 100644
--- a/src/main/java/org/alfresco/repo/site/SitesPermissionCleaner.java
+++ b/src/main/java/org/alfresco/repo/site/SitesPermissionCleaner.java
@@ -1,28 +1,28 @@
-/*
- * #%L
- * Alfresco Repository
- * %%
- * Copyright (C) 2005 - 2016 Alfresco Software Limited
- * %%
- * This file is part of the Alfresco software.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- * #L%
- */
+/*
+ * #%L
+ * Alfresco Repository
+ * %%
+ * Copyright (C) 2005 - 2016 Alfresco Software Limited
+ * %%
+ * This file is part of the Alfresco software.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * Alfresco is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Alfresco is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ * #L%
+ */
package org.alfresco.repo.site;
import java.util.List;
@@ -31,6 +31,7 @@ import org.alfresco.repo.domain.node.NodeDAO;
import org.alfresco.repo.domain.node.NodeIdAndAclId;
import org.alfresco.repo.domain.permissions.Acl;
import org.alfresco.repo.domain.permissions.AclDAO;
+import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.permissions.ACLType;
import org.alfresco.repo.security.permissions.AccessControlEntry;
import org.alfresco.repo.security.permissions.AccessControlList;
@@ -99,62 +100,70 @@ public class SitesPermissionCleaner
public void cleanSitePermissions(final NodeRef targetNode, SiteInfo containingSite)
{
- if (nodeDAO.exists(targetNode))
+ if (!nodeDAO.exists(targetNode))
{
- // We can calculate the containing site at the start of a recursive call & then reuse it on subsequent calls.
- if (containingSite == null)
- {
- containingSite = siteServiceImpl.getSite(targetNode);
- }
+ return;
+ }
+ // We can calculate the containing site at the start of a recursive call & then reuse it on subsequent calls.
+ if (containingSite == null)
+ {
+ containingSite = siteServiceImpl.getSite(targetNode);
+ }
- // Short-circuit at this point if the node is not in a Site.
- if (containingSite != null)
+ // Short-circuit at this point if the node is not in a Site.
+ if (containingSite == null)
+ {
+ return;
+ }
+ // For performance reasons we navigate down the containment hierarchy using the DAOs
+ // rather than the NodeService. Note: direct use of NodeDAO requires tenantService (ALF-12732).
+ final Long targetNodeID = nodeDAO.getNodePair(tenantService.getName(targetNode)).getFirst();
+ final Long targetNodeAclID = nodeDAO.getNodeAclId(targetNodeID);
+ Acl targetNodeAcl = aclDAO.getAcl(targetNodeAclID);
+
+ // Nodes that don't have defining ACLs do not need to be considered.
+ if (targetNodeAcl.getAclType() == ACLType.DEFINING)
+ {
+ AccessControlList targetNodeAccessControlList = aclDAO.getAccessControlList(targetNodeAclID);
+ List targetNodeAclEntries = targetNodeAccessControlList.getEntries();
+ for (AccessControlEntry entry : targetNodeAclEntries)
{
- // For performance reasons we navigate down the containment hierarchy using the DAOs
- // rather than the NodeService. Note: direct use of NodeDAO requires tenantService (ALF-12732).
- final Long targetNodeID = nodeDAO.getNodePair(tenantService.getName(targetNode)).getFirst();
- final Long targetNodeAclID = nodeDAO.getNodeAclId(targetNodeID);
- Acl targetNodeAcl = aclDAO.getAcl(targetNodeAclID);
-
- // Nodes that don't have defining ACLs do not need to be considered.
- if (targetNodeAcl.getAclType() == ACLType.DEFINING)
+ String authority = entry.getAuthority();
+
+ String thisSiteGroupPrefix = siteServiceImpl.getSiteGroup(containingSite.getShortName(), true);
+
+ // If it's a group site permission for a site other than the current site
+ if (authority.startsWith(PermissionService.GROUP_PREFIX) &&
+ // And it's not GROUP_EVERYONE
+ !authority.startsWith(PermissionService.ALL_AUTHORITIES) && !authority.startsWith(thisSiteGroupPrefix) &&
+ // And if the current user has permissions to do it
+ publicServiceAccessService.hasAccess("PermissionService", "clearPermission", targetNode, authority) == AccessStatus.ALLOWED)
{
- AccessControlList targetNodeAccessControlList = aclDAO.getAccessControlList(targetNodeAclID);
- List targetNodeAclEntries = targetNodeAccessControlList.getEntries();
- for (AccessControlEntry entry : targetNodeAclEntries)
- {
- String authority = entry.getAuthority();
-
- String thisSiteGroupPrefix = siteServiceImpl.getSiteGroup(containingSite.getShortName(), true);
-
- // If it's a group site permission for a site other than the current site
- if (authority.startsWith(PermissionService.GROUP_PREFIX) &&
- !authority.startsWith(PermissionService.ALL_AUTHORITIES) && // And it's not GROUP_EVERYONE
- !authority.startsWith(thisSiteGroupPrefix))
- {
- // And if the current user has permissions to do it
- if (publicServiceAccessService.hasAccess("PermissionService", "clearPermission", targetNode, authority) == AccessStatus.ALLOWED)
- {
- // Then remove it.
- permissionService.clearPermission(targetNode, authority);
- }
- if (publicServiceAccessService.hasAccess("PermissionService", "setInheritParentPermissions", targetNode, true) == AccessStatus.ALLOWED)
- {
- // And reenable permission inheritance.
- permissionService.setInheritParentPermissions(targetNode, true);
- }
- }
-
- }
+ // Then remove it.
+ permissionService.clearPermission(targetNode, authority);
}
-
- // Recurse
- List childNodeIds = nodeDAO.getPrimaryChildrenAcls(targetNodeID);
- for (NodeIdAndAclId nextChild : childNodeIds)
+
+ if (!permissionService.getInheritParentPermissions(targetNode))
{
- cleanSitePermissions(nodeDAO.getNodePair(nextChild.getId()).getSecond(), containingSite);
+ // The site manager from the new site, where this node was moved to, has to have permission to this node
+ String siteManagerAuthority = thisSiteGroupPrefix + "_" + SiteModel.SITE_MANAGER;
+ AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork()
+ {
+ public Void doWork() throws Exception
+ {
+ permissionService.setPermission(targetNode, siteManagerAuthority, SiteModel.SITE_MANAGER, true);
+ return null;
+ }
+ }, AuthenticationUtil.getSystemUserName());
}
}
}
+
+ // Recurse
+ List childNodeIds = nodeDAO.getPrimaryChildrenAcls(targetNodeID);
+ for (NodeIdAndAclId nextChild : childNodeIds)
+ {
+ cleanSitePermissions(nodeDAO.getNodePair(nextChild.getId()).getSecond(), containingSite);
+ }
}
}
diff --git a/src/main/resources/alfresco-global.properties.sample b/src/main/resources/alfresco-global.properties.sample
index a76e00e0a1..781a79a9db 100644
--- a/src/main/resources/alfresco-global.properties.sample
+++ b/src/main/resources/alfresco-global.properties.sample
@@ -29,7 +29,6 @@
#
#img.coders=${img.root}/modules/coders
#img.config=${img.root}/config
-#img.gslib=${img.root}/lib
#
# Property to control whether schema updates are performed automatically.
@@ -69,16 +68,16 @@
#db.url=jdbc:postgresql://localhost:5432/alfresco
#
-# DB2 connection
-#
-#db.driver=com.ibm.db2.jcc.DB2Driver
-#db.url=jdbc:db2://localhost:50000/alfresco:retrieveMessagesFromServerOnGetMessage=true;
+# DB2 connection
+#
+#db.driver=com.ibm.db2.jcc.DB2Driver
+#db.url=jdbc:db2://localhost:50000/alfresco:retrieveMessagesFromServerOnGetMessage=true;
#
# When schema is used which does not match DB2 username then currentSchema and hibernate.default_schema should be set
#db.url=jdbc:db2://localhost:50000/alfresco:retrieveMessagesFromServerOnGetMessage=true;currentSchema=${hibernate.default_schema};
#hibernate.default_schema=SAMPLE_SCHEMA
-
-#
+
+#
# Index Recovery Mode
#-------------
#index.recovery.mode=AUTO
@@ -142,11 +141,11 @@
#imap.server.port=143
#imap.server.host=localhost
-# Default value of alfresco.rmi.services.host is 0.0.0.0 which means 'listen on all adapters'.
-# This allows connections to JMX both remotely and locally.
+# Default value of alfresco.rmi.services.host is 0.0.0.0 which means 'listen on all adapters'.
+# This allows connections to JMX both remotely and locally.
#
-alfresco.rmi.services.host=0.0.0.0
-
+alfresco.rmi.services.host=0.0.0.0
+
#
#
# Assign individual ports for each service for best performance
diff --git a/src/main/resources/alfresco/subsystems/thirdparty/default/alfresco-pdf-renderer-transform-context.xml b/src/main/resources/alfresco/subsystems/thirdparty/default/alfresco-pdf-renderer-transform-context.xml
index 08d4cacf74..024e724778 100644
--- a/src/main/resources/alfresco/subsystems/thirdparty/default/alfresco-pdf-renderer-transform-context.xml
+++ b/src/main/resources/alfresco/subsystems/thirdparty/default/alfresco-pdf-renderer-transform-context.xml
@@ -20,7 +20,7 @@
-
+
@@ -47,7 +47,7 @@
-
+
-
+
-
+
@@ -50,7 +50,7 @@
-
+
-
+