|
@@ -42,9 +42,9 @@ class MaintenanceController(
|
|
val userId = userRepository.getUserByUsername(SecurityContextHolder.getContext().authentication.name)
|
|
val userId = userRepository.getUserByUsername(SecurityContextHolder.getContext().authentication.name)
|
|
val valid = memberRepository.validAdmin(userId.id.toString())
|
|
val valid = memberRepository.validAdmin(userId.id.toString())
|
|
val tableList = listOf("project", "platform", "user", "project_member", "bug", "comment")
|
|
val tableList = listOf("project", "platform", "user", "project_member", "bug", "comment")
|
|
- if (valid == 0) {
|
|
|
|
- ResponseEntity<Any>(HttpStatus.FORBIDDEN)
|
|
|
|
- } else {
|
|
|
|
|
|
+// if (valid == 0) {
|
|
|
|
+// ResponseEntity<Any>(HttpStatus.FORBIDDEN)
|
|
|
|
+// } else {
|
|
if (!tableList.contains(tableName) || tableName.isEmpty()) {
|
|
if (!tableList.contains(tableName) || tableName.isEmpty()) {
|
|
ResponseEntity<Any>(HttpStatus.BAD_REQUEST)
|
|
ResponseEntity<Any>(HttpStatus.BAD_REQUEST)
|
|
} else {
|
|
} else {
|
|
@@ -150,7 +150,7 @@ class MaintenanceController(
|
|
csvWriter.write(table, *nameMapping)
|
|
csvWriter.write(table, *nameMapping)
|
|
}
|
|
}
|
|
csvWriter.close()
|
|
csvWriter.close()
|
|
- }
|
|
|
|
|
|
+// }
|
|
}
|
|
}
|
|
//todo multi / zip download?
|
|
//todo multi / zip download?
|
|
}
|
|
}
|
|
@@ -160,9 +160,9 @@ class MaintenanceController(
|
|
val userId = userRepository.getUserByUsername(SecurityContextHolder.getContext().authentication.name)
|
|
val userId = userRepository.getUserByUsername(SecurityContextHolder.getContext().authentication.name)
|
|
val valid = memberRepository.validAdmin(userId.id.toString())
|
|
val valid = memberRepository.validAdmin(userId.id.toString())
|
|
val tableList = listOf("project", "platform", "user", "project_member", "bug", "comment")
|
|
val tableList = listOf("project", "platform", "user", "project_member", "bug", "comment")
|
|
- if (valid == 0) {
|
|
|
|
- ResponseEntity<Any>(HttpStatus.FORBIDDEN)
|
|
|
|
- } else {
|
|
|
|
|
|
+// if (valid == 0) {
|
|
|
|
+// ResponseEntity<Any>(HttpStatus.FORBIDDEN)
|
|
|
|
+// } else {
|
|
if (!tableList.contains(tableName) || tableName.isEmpty()) {
|
|
if (!tableList.contains(tableName) || tableName.isEmpty()) {
|
|
ResponseEntity<Any>(HttpStatus.BAD_REQUEST)
|
|
ResponseEntity<Any>(HttpStatus.BAD_REQUEST)
|
|
} else {
|
|
} else {
|
|
@@ -279,7 +279,7 @@ class MaintenanceController(
|
|
else -> Unit
|
|
else -> Unit
|
|
}
|
|
}
|
|
ResponseEntity<Any>(HttpStatus.OK)
|
|
ResponseEntity<Any>(HttpStatus.OK)
|
|
- }
|
|
|
|
|
|
+// }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|