mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-22 15:12:38 +00:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14da8d2002 | ||
|
|
6a4bbb021c | ||
|
|
42d70b17c7 | ||
|
|
c7eba0ddc8 | ||
|
|
266094c0e1 | ||
|
|
e442b4acf0 | ||
|
|
fd1028a685 | ||
|
|
0a7e275a9c | ||
|
|
d1bbba7286 | ||
|
|
e1baddebee | ||
|
|
3263dcaf2f | ||
|
|
8926f7f9a7 | ||
|
|
764a1b656c | ||
|
|
cf265f2dea | ||
|
|
fd0d5204eb | ||
|
|
f9b8a4b42d | ||
|
|
fcdc1438e7 | ||
|
|
7cd1416561 | ||
|
|
f197757f94 |
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||
<version>25.3.0.56</version>
|
||||
<version>25.3.0.62-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||
<version>25.3.0.56</version>
|
||||
<version>25.3.0.62-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-automation-community-repo</artifactId>
|
||||
<version>25.3.0.56</version>
|
||||
<version>25.3.0.62-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||
<version>25.3.0.56</version>
|
||||
<version>25.3.0.62-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||
<version>25.3.0.56</version>
|
||||
<version>25.3.0.62-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -31,6 +31,7 @@ import static org.alfresco.service.cmr.security.PermissionService.GROUP_PREFIX;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -247,7 +248,7 @@ public class ExtendedSecurityServiceImpl extends ServiceBaseImpl
|
||||
*/
|
||||
private Set<String> getAuthorities(String group)
|
||||
{
|
||||
Set<String> result = new HashSet<>();
|
||||
Set<String> result = new LinkedHashSet<>();
|
||||
result.addAll(authorityService.getContainedAuthorities(null, group, true));
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -325,8 +326,8 @@ public class ExtendedPermissionServiceImpl extends PermissionServiceImpl impleme
|
||||
return aclReaders;
|
||||
}
|
||||
|
||||
HashSet<String> assigned = new HashSet<>();
|
||||
HashSet<String> readers = new HashSet<>();
|
||||
Set<String> assigned = new LinkedHashSet<>();
|
||||
Set<String> readers = new LinkedHashSet<>();
|
||||
|
||||
for (AccessControlEntry ace : acl.getEntries())
|
||||
{
|
||||
@@ -412,8 +413,8 @@ public class ExtendedPermissionServiceImpl extends PermissionServiceImpl impleme
|
||||
return aclWriters;
|
||||
}
|
||||
|
||||
HashSet<String> assigned = new HashSet<>();
|
||||
HashSet<String> readers = new HashSet<>();
|
||||
Set<String> assigned = new LinkedHashSet<>();
|
||||
Set<String> readers = new LinkedHashSet<>();
|
||||
|
||||
for (AccessControlEntry ace : acl.getEntries())
|
||||
{
|
||||
@@ -485,7 +486,7 @@ public class ExtendedPermissionServiceImpl extends PermissionServiceImpl impleme
|
||||
Set<String> writers = getWriters(aclId);
|
||||
|
||||
// add the current owner to the list of extended writers
|
||||
Set<String> modifiedWrtiers = new HashSet<>(writers);
|
||||
Set<String> modifiedWrtiers = new LinkedHashSet<>(writers);
|
||||
String owner = ownableService.getOwner(nodeRef);
|
||||
if (StringUtils.isNotBlank(owner) &&
|
||||
!owner.equals(OwnableService.NO_OWNER) &&
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||
<version>25.3.0.56</version>
|
||||
<version>25.3.0.62-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.3.0.56</version>
|
||||
<version>25.3.0.62-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||
<version>25.3.0.56</version>
|
||||
<version>25.3.0.62-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.3.0.56</version>
|
||||
<version>25.3.0.62-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.3.0.56</version>
|
||||
<version>25.3.0.62-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.3.0.56</version>
|
||||
<version>25.3.0.62-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -9,6 +9,6 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>25.3.0.56</version>
|
||||
<version>25.3.0.62-SNAPSHOT</version>
|
||||
</parent>
|
||||
</project>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>25.3.0.56</version>
|
||||
<version>25.3.0.62-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.3.0.56</version>
|
||||
<version>25.3.0.62-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>25.3.0.56</version>
|
||||
<version>25.3.0.62-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>25.3.0.56</version>
|
||||
<version>25.3.0.62-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<organization>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>25.3.0.56</version>
|
||||
<version>25.3.0.62-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>25.3.0.56</version>
|
||||
<version>25.3.0.62-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>25.3.0.56</version>
|
||||
<version>25.3.0.62-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>25.3.0.56</version>
|
||||
<version>25.3.0.62-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>25.3.0.56</version>
|
||||
<version>25.3.0.62-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
||||
4
pom.xml
4
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>25.3.0.56</version>
|
||||
<version>25.3.0.62-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Alfresco Community Repo Parent</name>
|
||||
|
||||
@@ -154,7 +154,7 @@
|
||||
<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>25.3.0.56</tag>
|
||||
<tag>HEAD</tag>
|
||||
</scm>
|
||||
|
||||
<distributionManagement>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.3.0.56</version>
|
||||
<version>25.3.0.62-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Remote API
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2025 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
@@ -31,7 +31,10 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.owasp.html.PolicyFactory;
|
||||
import org.owasp.html.Sanitizers;
|
||||
import org.springframework.extensions.webscripts.Cache;
|
||||
import org.springframework.extensions.webscripts.Status;
|
||||
import org.springframework.extensions.webscripts.WebScriptRequest;
|
||||
@@ -67,6 +70,19 @@ public class CommentsPost extends AbstractCommentsWebScript
|
||||
// get json object from request
|
||||
JSONObject json = parseJSON(req);
|
||||
|
||||
// Validating and Sanitizing comment content to prevent XSS
|
||||
String commentContent = getOrNull(json, "content");
|
||||
if (StringUtils.isBlank(commentContent))
|
||||
{
|
||||
throw new IllegalArgumentException("Comment content must not be empty");
|
||||
}
|
||||
else
|
||||
{
|
||||
PolicyFactory policy = Sanitizers.FORMATTING.and(Sanitizers.LINKS);
|
||||
String safeContent = policy.sanitize(commentContent);
|
||||
json.replace("content", safeContent);
|
||||
}
|
||||
|
||||
/* MNT-10231, MNT-9771 fix */
|
||||
this.behaviourFilter.disableBehaviour(nodeRef, ContentModel.ASPECT_AUDITABLE);
|
||||
|
||||
|
||||
@@ -45,12 +45,8 @@
|
||||
"parentType": "${row.item.parentTypeShort!""}",
|
||||
"isContainer": ${row.item.isContainer?string},
|
||||
<#if row.container??>"container": "${row.container!""}",</#if>
|
||||
<#if row.item.properties?? && row.item.properties.name??>
|
||||
"name": "${row.item.properties.name!""}",
|
||||
<#else>
|
||||
"name": "${(row.item.name)!row.item?string!""}",
|
||||
</#if>
|
||||
<#if row.item.aspects??>
|
||||
"name": "${row.item.properties.name!""}",
|
||||
<#if row.item.aspects??>
|
||||
"aspects": [
|
||||
<#list row.item.aspects as aspect>
|
||||
"${shortQName(aspect)}"
|
||||
@@ -58,15 +54,10 @@
|
||||
</#list>
|
||||
],
|
||||
</#if>
|
||||
<#if row.item.properties??>
|
||||
"title":<#if row.item.properties["lnk:title"]??>"${row.item.properties["lnk:title"]}",
|
||||
<#elseif row.item.properties["ia:whatEvent"]??>"${row.item.properties["ia:whatEvent"]}",
|
||||
<#else>"${row.item.properties.title!""}",</#if>
|
||||
"description": "${row.item.properties.description!""}",
|
||||
<#else>
|
||||
"title": "${(row.item.name)!row.item?string!""}",
|
||||
"description": "",
|
||||
</#if>
|
||||
"title":<#if row.item.properties["lnk:title"]??>"${row.item.properties["lnk:title"]}",
|
||||
<#elseif row.item.properties["ia:whatEvent"]??>"${row.item.properties["ia:whatEvent"]}",
|
||||
<#else>"${row.item.properties.title!""}",</#if>
|
||||
"description": "${row.item.properties.description!""}",
|
||||
<#if row.item.properties.modified??>"modified": "${xmldate(row.item.properties.modified)}",</#if>
|
||||
<#if row.item.properties.modifier??>"modifier": "${row.item.properties.modifier}",</#if>
|
||||
<#if row.item.siteShortName??>"site": "${row.item.siteShortName}",</#if>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.3.0.56</version>
|
||||
<version>25.3.0.62-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
||||
Reference in New Issue
Block a user