@ -281,8 +281,6 @@ public class WebController {
|
|||||||
validationService.checkGroup(group.getTitle());
|
validationService.checkGroup(group.getTitle());
|
||||||
model.addAttribute("group", group);
|
model.addAttribute("group", group);
|
||||||
|
|
||||||
//controllerService.addUser(keyCloakService.createAccountFromPrincipal(token), group.getId());
|
|
||||||
|
|
||||||
if (group.getVisibility() == Visibility.PUBLIC) {
|
if (group.getVisibility() == Visibility.PUBLIC) {
|
||||||
return "redirect:/gruppen2/details/" + group.getId();
|
return "redirect:/gruppen2/details/" + group.getId();
|
||||||
}
|
}
|
||||||
@ -300,7 +298,7 @@ public class WebController {
|
|||||||
|
|
||||||
User user = new User(acc.getName(), acc.getGivenname(), acc.getFamilyname(), acc.getEmail());
|
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));
|
controllerService.addUser(keyCloakService.createAccountFromPrincipal(token), UUID.fromString(groupId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,6 +62,11 @@ public class ValidationService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Warum ist das überhaupt nötig smh
|
||||||
|
public boolean checkIfUserInGroupWithoutNoAccessAcception(Group group, User user) {
|
||||||
|
return group.getMembers().contains(user);
|
||||||
|
}
|
||||||
|
|
||||||
public Group checkParent(UUID parentId) {
|
public Group checkParent(UUID parentId) {
|
||||||
Group parent = new Group();
|
Group parent = new Group();
|
||||||
if (!controllerService.idIsEmpty(parentId)) {
|
if (!controllerService.idIsEmpty(parentId)) {
|
||||||
|
Reference in New Issue
Block a user