added @Secured and fixed
Co-authored-by: LukasEttel <lukas.ettie@yahoo.de> Co-authored-by: AndiBuls <andreas.buls@uni-duesseldorf.de>
This commit is contained in:
@ -44,12 +44,15 @@ public class APIController {
|
||||
}
|
||||
|
||||
@GetMapping("/getGroupIdsOfUser/{teilnehmer}")
|
||||
@Secured("ROLE_api_user")
|
||||
|
||||
@ApiOperation(value = "Gibt alle Gruppen zurück in denen sich ein Teilnehmer befindet")
|
||||
public List<Long> getGroupsOfUser(@ApiParam("Teilnehmer dessen groupIds zurückgegeben werden sollen") @PathVariable String teilnehmer) throws EventException {
|
||||
return eventService.getGroupsOfUser(teilnehmer);
|
||||
}
|
||||
|
||||
@GetMapping("/getGroup/{groupId}")
|
||||
@Secured("ROLE_api_user")
|
||||
@ApiOperation(value = "Gibt die Gruppe mit der als Parameter mitgegebenden groupId zurück")
|
||||
public Group getGroupFromId(@ApiParam("GruppenId der gefordeten Gruppe") @PathVariable Long groupId) throws EventException{
|
||||
List<Event> eventList = eventService.getEventsOfGroup(groupId);
|
||||
|
||||
@ -3,8 +3,7 @@ package mops.gruppen2.controller;
|
||||
import mops.gruppen2.config.Gruppen2Config;
|
||||
import mops.gruppen2.domain.Exceptions.EventException;
|
||||
import mops.gruppen2.domain.Group;
|
||||
import mops.gruppen2.domain.GroupType;
|
||||
import mops.gruppen2.domain.Role;
|
||||
|
||||
import mops.gruppen2.domain.User;
|
||||
import mops.gruppen2.security.Account;
|
||||
import mops.gruppen2.service.*;
|
||||
@ -20,7 +19,6 @@ import org.springframework.web.server.ResponseStatusException;
|
||||
import javax.annotation.security.RolesAllowed;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/gruppen2")
|
||||
@ -28,8 +26,6 @@ public class Gruppen2Controller {
|
||||
|
||||
@Autowired
|
||||
Gruppen2Config gruppen2Config;
|
||||
@Autowired
|
||||
RestTemplate serviceAccountRestTemplate;
|
||||
|
||||
private final KeyCloakService keyCloakService;
|
||||
private final EventService eventService;
|
||||
|
||||
Reference in New Issue
Block a user