1

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

This commit is contained in:
[Mahgs]
2020-03-16 16:18:25 +01:00
6 changed files with 116 additions and 54 deletions

View File

@ -111,4 +111,16 @@ public class Gruppen2Controller {
throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Group not found");
}
@RolesAllowed({"ROLE_orga", "ROLE_studentin", "ROLE_actuator)"})
@GetMapping("/detailsSearch")
public String showGroupDetailsNoMember (KeycloakAuthenticationToken token, Model model, @RequestParam (value="id") Long id) throws EventException {
model.addAttribute("account", keyCloakService.createAccountFromPrincipal(token));
Group group = userService.getGroupById(id);
if (group!=null) {
model.addAttribute("group", group);
return "detailsNoMember";
}
throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Group not found");
}
}