package at.ac.tuwien.inso.service;

import at.ac.tuwien.inso.entity.*;
import org.springframework.transaction.annotation.Transactional;

import java.util.*;

public interface StudyPlanService {

    StudyPlan create(StudyPlan studyPlan);

    List<StudyPlan> findAll();

    StudyPlan findOne(Long id);

    List<SubjectForStudyPlan> getSubjectsForStudyPlan(Long id);

    void addSubjectToStudyPlan(SubjectForStudyPlan subjectForStudyPlan);

    List<Subject> getAvailableSubjectsForStudyPlan(Long id, String query);
}

@@ -63,16 +63,82 @@
 ntity.*;
+%0A%0Aimport org.springframework.security.access.prepost.PreAuthorize;
 %0Aimport 
@@ -254,16 +254,54 @@
 vice %7B%0A%0A
+    @PreAuthorize(%22hasRole('ADMIN')%22)%0A
     Stud
@@ -344,68 +344,185 @@
     
-List%3CStudyPlan%3E findAll();%0A%0A    StudyPlan findOne(Long id);%0A
+@PreAuthorize(%22isAuthenticated()%22)%0A    List%3CStudyPlan%3E findAll();%0A%0A    @PreAuthorize(%22isAuthenticated()%22)%0A    StudyPlan findOne(Long id);%0A%0A    @PreAuthorize(%22isAuthenticated()%22)
 %0A   
@@ -579,24 +579,62 @@
 (Long id);%0A%0A
+    @PreAuthorize(%22hasRole('ADMIN')%22)%0A
     void add
@@ -691,24 +691,63 @@
 tudyPlan);%0A%0A
+    @PreAuthorize(%22isAuthenticated()%22)%0A
     List%3CSub

Add StudyPlanService method security