fix(系统设置): 权限页面的数据回显问题
This commit is contained in:
parent
5b05eadeb8
commit
15b9d260b5
|
@ -3,10 +3,13 @@ package io.metersphere.dto;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class GroupJson {
|
public class GroupJson implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private List<GroupResource> resource;
|
private List<GroupResource> resource;
|
||||||
private List<GroupPermission> permissions;
|
private List<GroupPermission> permissions;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,12 @@ package io.metersphere.dto;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class GroupPermission {
|
public class GroupPermission implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private String id;
|
private String id;
|
||||||
private String name;
|
private String name;
|
||||||
private String resourceId;
|
private String resourceId;
|
||||||
|
|
|
@ -2,8 +2,12 @@ package io.metersphere.dto;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class GroupResource {
|
public class GroupResource implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private String id;
|
private String id;
|
||||||
private String name;
|
private String name;
|
||||||
private Boolean license = false;
|
private Boolean license = false;
|
||||||
|
|
|
@ -23,6 +23,7 @@ import io.metersphere.log.vo.OperatingLogDetails;
|
||||||
import io.metersphere.log.vo.system.SystemReference;
|
import io.metersphere.log.vo.system.SystemReference;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.apache.commons.lang3.BooleanUtils;
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
|
import org.apache.commons.lang3.SerializationUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.ibatis.session.ExecutorType;
|
import org.apache.ibatis.session.ExecutorType;
|
||||||
import org.apache.ibatis.session.SqlSession;
|
import org.apache.ibatis.session.SqlSession;
|
||||||
|
@ -178,8 +179,9 @@ public class GroupService {
|
||||||
if (groupJson == null) {
|
if (groupJson == null) {
|
||||||
MSException.throwException(Translator.get("read_permission_file_fail"));
|
MSException.throwException(Translator.get("read_permission_file_fail"));
|
||||||
}
|
}
|
||||||
List<GroupResource> resource = groupJson.getResource();
|
GroupJson groupJsonCopy = SerializationUtils.clone(groupJson);
|
||||||
List<GroupPermission> permissions = groupJson.getPermissions();
|
List<GroupResource> resource = groupJsonCopy.getResource();
|
||||||
|
List<GroupPermission> permissions = groupJsonCopy.getPermissions();
|
||||||
List<GroupResourceDTO> dtoPermissions = dto.getPermissions();
|
List<GroupResourceDTO> dtoPermissions = dto.getPermissions();
|
||||||
dtoPermissions.addAll(getResourcePermission(resource, permissions, group.getType(), permissionList));
|
dtoPermissions.addAll(getResourcePermission(resource, permissions, group.getType(), permissionList));
|
||||||
return dto;
|
return dto;
|
||||||
|
|
Loading…
Reference in New Issue