#961: Give each user its own schema for the lessons
This way we can reset a lesson using the database for each user and not for all users at once. Also solves the issue that when someone solves the lesson it is solved for all users on the same WebGoat instance
This commit is contained in:
@ -83,7 +83,7 @@ public class MissingFunctionACUsers {
|
||||
//@PreAuthorize()
|
||||
public WebGoatUser addUser(@RequestBody WebGoatUser newUser) {
|
||||
try {
|
||||
userService.addUser(newUser.getUsername(),newUser.getPassword(),newUser.getRole());
|
||||
userService.addUser(newUser.getUsername(),newUser.getPassword());
|
||||
return userService.loadUserByUsername(newUser.getUsername());
|
||||
} catch (Exception ex) {
|
||||
log.error("Error creating new User", ex);
|
||||
|
@ -22,11 +22,11 @@
|
||||
|
||||
package org.owasp.webgoat.missing_ac;
|
||||
|
||||
import org.owasp.webgoat.LessonDataSource;
|
||||
import org.owasp.webgoat.session.UserSessionData;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
@ -36,9 +36,9 @@ import java.util.HashMap;
|
||||
public class Users {
|
||||
|
||||
private UserSessionData userSessionData;
|
||||
private DataSource dataSource;
|
||||
private LessonDataSource dataSource;
|
||||
|
||||
public Users(UserSessionData userSessionData, DataSource dataSource) {
|
||||
public Users(UserSessionData userSessionData, LessonDataSource dataSource) {
|
||||
this.userSessionData = userSessionData;
|
||||
this.dataSource = dataSource;
|
||||
}
|
||||
|
Reference in New Issue
Block a user