1

Merge remote-tracking branch 'origin/master' into controllerAndControllerServiceRefactor

# Conflicts:
#	src/main/java/mops/gruppen2/service/ValidationService.java
#	src/test/java/mops/gruppen2/service/ControllerServiceTest.java
This commit is contained in:
XXNitram
2020-03-27 15:33:45 +01:00
7 changed files with 429 additions and 39 deletions

View File

@ -294,8 +294,6 @@ public class WebController {
model.addAttribute("account", keyCloakService.createAccountFromPrincipal(token));
model.addAttribute("group", group);
//controllerService.addUser(keyCloakService.createAccountFromPrincipal(token), group.getId());
if (group.getVisibility() == Visibility.PUBLIC) {
return "redirect:/gruppen2/details/" + group.getId();
}
@ -313,7 +311,7 @@ public class WebController {
User user = new User(acc.getName(), acc.getGivenname(), acc.getFamilyname(), acc.getEmail());
if (!validationService.checkIfUserInGroup(userService.getGroupById(UUID.fromString(groupId)), user)) {
if (!validationService.checkIfUserInGroupWithoutNoAccessAcception(userService.getGroupById(UUID.fromString(groupId)), user)) {
controllerService.addUser(keyCloakService.createAccountFromPrincipal(token), UUID.fromString(groupId));
}

View File

@ -47,8 +47,7 @@ class SecurityConfig extends KeycloakWebSecurityConfigurerAdapter {
}
@Bean
@Scope(scopeName = WebApplicationContext.SCOPE_REQUEST,
proxyMode = ScopedProxyMode.TARGET_CLASS)
@Scope(scopeName = WebApplicationContext.SCOPE_REQUEST, proxyMode = ScopedProxyMode.TARGET_CLASS)
public AccessToken getAccessToken() {
HttpServletRequest request =
((ServletRequestAttributes) RequestContextHolder

View File

@ -171,6 +171,7 @@ public class ControllerService {
}
private List<User> readCsvFile(MultipartFile file) throws EventException, IOException {
if(file == null) return new ArrayList<>();
if (!file.isEmpty()) {
try {
List<User> userList = CsvService.read(file.getInputStream());