diff --git a/backend/src/main/java/io/metersphere/dto/GroupJson.java b/backend/src/main/java/io/metersphere/dto/GroupJson.java index 63d07899a1..002f7c20df 100644 --- a/backend/src/main/java/io/metersphere/dto/GroupJson.java +++ b/backend/src/main/java/io/metersphere/dto/GroupJson.java @@ -3,10 +3,13 @@ package io.metersphere.dto; import lombok.Data; +import java.io.Serializable; import java.util.List; @Data -public class GroupJson { +public class GroupJson implements Serializable { + private static final long serialVersionUID = 1L; + private List resource; private List permissions; } diff --git a/backend/src/main/java/io/metersphere/dto/GroupPermission.java b/backend/src/main/java/io/metersphere/dto/GroupPermission.java index ca47d4f34a..bf5632c29c 100644 --- a/backend/src/main/java/io/metersphere/dto/GroupPermission.java +++ b/backend/src/main/java/io/metersphere/dto/GroupPermission.java @@ -2,8 +2,12 @@ package io.metersphere.dto; import lombok.Data; +import java.io.Serializable; + @Data -public class GroupPermission { +public class GroupPermission implements Serializable { + private static final long serialVersionUID = 1L; + private String id; private String name; private String resourceId; diff --git a/backend/src/main/java/io/metersphere/dto/GroupResource.java b/backend/src/main/java/io/metersphere/dto/GroupResource.java index a66fad306c..9ad0cbe03c 100644 --- a/backend/src/main/java/io/metersphere/dto/GroupResource.java +++ b/backend/src/main/java/io/metersphere/dto/GroupResource.java @@ -2,8 +2,12 @@ package io.metersphere.dto; import lombok.Data; +import java.io.Serializable; + @Data -public class GroupResource { +public class GroupResource implements Serializable { + private static final long serialVersionUID = 1L; + private String id; private String name; private Boolean license = false; diff --git a/backend/src/main/java/io/metersphere/service/GroupService.java b/backend/src/main/java/io/metersphere/service/GroupService.java index a4b8274af7..c86db13f80 100644 --- a/backend/src/main/java/io/metersphere/service/GroupService.java +++ b/backend/src/main/java/io/metersphere/service/GroupService.java @@ -23,6 +23,7 @@ import io.metersphere.log.vo.OperatingLogDetails; import io.metersphere.log.vo.system.SystemReference; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.BooleanUtils; +import org.apache.commons.lang3.SerializationUtils; import org.apache.commons.lang3.StringUtils; import org.apache.ibatis.session.ExecutorType; import org.apache.ibatis.session.SqlSession; @@ -178,8 +179,9 @@ public class GroupService { if (groupJson == null) { MSException.throwException(Translator.get("read_permission_file_fail")); } - List resource = groupJson.getResource(); - List permissions = groupJson.getPermissions(); + GroupJson groupJsonCopy = SerializationUtils.clone(groupJson); + List resource = groupJsonCopy.getResource(); + List permissions = groupJsonCopy.getPermissions(); List dtoPermissions = dto.getPermissions(); dtoPermissions.addAll(getResourcePermission(resource, permissions, group.getType(), permissionList)); return dto;