|
@@ -70,7 +70,6 @@ public class PropertyController {
|
|
@RequestParam Long versionId, @RequestParam Long moduleId, @RequestParam MultipartFile file,
|
|
@RequestParam Long versionId, @RequestParam Long moduleId, @RequestParam MultipartFile file,
|
|
@RequestParam FileFormat extension, @RequestParam(required = false) Long inheritVersionId)
|
|
@RequestParam FileFormat extension, @RequestParam(required = false) Long inheritVersionId)
|
|
throws IOException {
|
|
throws IOException {
|
|
- adminSession.validateRole(Role.ADMIN, Role.DEV);
|
|
|
|
return propertyService.updateBaseline(appService.getById(appId), versionService.getById(versionId),
|
|
return propertyService.updateBaseline(appService.getById(appId), versionService.getById(versionId),
|
|
moduleService.getById(moduleId), file.getInputStream(), extension,
|
|
moduleService.getById(moduleId), file.getInputStream(), extension,
|
|
inheritVersionId != null ? versionService.getById(inheritVersionId) : null);
|
|
inheritVersionId != null ? versionService.getById(inheritVersionId) : null);
|
|
@@ -78,7 +77,6 @@ public class PropertyController {
|
|
|
|
|
|
@PostMapping("/baseline/item/update")
|
|
@PostMapping("/baseline/item/update")
|
|
public PropertyItem updateBaselineItem(@RequestAttribute AdminSession adminSession, PropertyItem item) {
|
|
public PropertyItem updateBaselineItem(@RequestAttribute AdminSession adminSession, PropertyItem item) {
|
|
- adminSession.validateRole(Role.ADMIN, Role.DEV);
|
|
|
|
return propertyService.updateBaselineItem(item);
|
|
return propertyService.updateBaselineItem(item);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -88,8 +86,7 @@ public class PropertyController {
|
|
Env env = envService.getById(envId);
|
|
Env env = envService.getById(envId);
|
|
List<PropertyItem> list = propertyService.listPropertyItem(appId, versionId, moduleId, env.getId());
|
|
List<PropertyItem> list = propertyService.listPropertyItem(appId, versionId, moduleId, env.getId());
|
|
//非管理员/运维角色,且非环境维护用户,需要隐藏机密信息
|
|
//非管理员/运维角色,且非环境维护用户,需要隐藏机密信息
|
|
- if (!adminSession.getUser().hasRole(Role.ADMIN, Role.OPS) && !adminSession.getUser().getId()
|
|
|
|
- .equals(env.getUserId())) {
|
|
|
|
|
|
+ if (!adminSession.getUser().hasRole(Role.ADMIN, Role.OPS)) {
|
|
for (PropertyItem item : list) {
|
|
for (PropertyItem item : list) {
|
|
//包含密钥/密码类信息
|
|
//包含密钥/密码类信息
|
|
if (item.getKey().contains("secret") || item.getKey().contains("password")) {
|
|
if (item.getKey().contains("secret") || item.getKey().contains("password")) {
|
|
@@ -119,13 +116,11 @@ public class PropertyController {
|
|
|
|
|
|
@PostMapping("/item/update")
|
|
@PostMapping("/item/update")
|
|
public PropertyItem updatePropertyItem(@RequestAttribute AdminSession adminSession, PropertyItem item) {
|
|
public PropertyItem updatePropertyItem(@RequestAttribute AdminSession adminSession, PropertyItem item) {
|
|
- adminSession.validateEnv(envService.getById(item.getEnvId()));
|
|
|
|
return propertyService.updatePropertyItem(item);
|
|
return propertyService.updatePropertyItem(item);
|
|
}
|
|
}
|
|
|
|
|
|
@PostMapping("/item/delete")
|
|
@PostMapping("/item/delete")
|
|
public Object deletePropertyItem(@RequestAttribute AdminSession adminSession, PropertyItem item) {
|
|
public Object deletePropertyItem(@RequestAttribute AdminSession adminSession, PropertyItem item) {
|
|
- adminSession.validateEnv(envService.getById(item.getEnvId()));
|
|
|
|
propertyService.deletePropertyItem(item);
|
|
propertyService.deletePropertyItem(item);
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
map.put("success", true);
|
|
map.put("success", true);
|