1

add some UI-improvements and functionality

This commit is contained in:
killerber4t
2020-03-14 01:11:56 +01:00
parent c4f90e0baf
commit 3849b61614
3 changed files with 31 additions and 25 deletions

View File

@ -74,7 +74,8 @@ public class Gruppen2Controller {
@PostMapping("/createGroup")
public String pCreateGroup(KeycloakAuthenticationToken token,
@RequestParam(value = "title") String title,
@RequestParam(value = "beschreibung") String beschreibung) {
@RequestParam(value = "beschreibung") String beschreibung,
@RequestParam(value = "visibility", required = false) Boolean visibility) {
Account account = keyCloakService.createAccountFromPrincipal(token);
controllerService.createGroup(account, title, beschreibung);
@ -89,10 +90,9 @@ public class Gruppen2Controller {
Group group = userService.getGroupById(id);
Account account = keyCloakService.createAccountFromPrincipal (token);
User user = new User(account.getName(), account.getGivenname(), account.getFamilyname(), account.getEmail());
Role role = group.getRoles().get(user);
if(group!= null) {
model.addAttribute("group", group);
model.addAttribute("role",role);
model.addAttribute("role", group.getRoles().get(user.getUser_id()));
return "detailsMember";
}
throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Group not found");