package at.ac.tuwien.inso.service;

import at.ac.tuwien.inso.controller.lecturer.GradeAuthorizationDTO;
import at.ac.tuwien.inso.entity.*;
import org.springframework.security.access.prepost.*;
import org.springframework.stereotype.*;

import java.util.*;

@Service
public interface GradeService {

    @PreAuthorize("hasRole('LECTURER')")
    GradeAuthorizationDTO getDefaultGradeAuthorizationDTOForStudentAndCourse(Long studentId, Long courseId);

    @PreAuthorize("hasRole('LECTURER')")
    Grade saveNewGradeForStudentAndCourse(GradeAuthorizationDTO grade);

    @PreAuthorize("hasRole('LECTURER')")
    List<Grade> getGradesForCourseOfLoggedInLecturer(Long courseId);

    @PreAuthorize("hasRole('STUDENT')")
    List<Grade> getGradesForLoggedInStudent();

    Grade getForValidation(String identifier);

    @PreAuthorize("isAuthenticated()")
    List<Grade> findAllOfStudent(Student student);

    @PreAuthorize("isAuthenticated()")
    List<Mark> getMarkOptions();
}

package at.ac.tuwien.inso.service;

import at.ac.tuwien.inso.entity.*;
import org.springframework.security.access.prepost.*;
import org.springframework.stereotype.*;

import java.util.*;

@Service
public interface GradeService {

    @PreAuthorize("hasRole('LECTURER')")
    Grade getDefaultGradeForStudentAndCourse(Long studentId, Long courseId);

    @PreAuthorize("hasRole('LECTURER')")
    Grade saveNewGradeForStudentAndCourse(Grade grade);

    @PreAuthorize("hasRole('LECTURER')")
    List<Grade> getGradesForCourseOfLoggedInLecturer(Long courseId);

    @PreAuthorize("hasRole('STUDENT')")
    List<Grade> getGradesForLoggedInStudent();

    Grade getForValidation(String identifier);

    @PreAuthorize("isAuthenticated()")
    List<Grade> findAllOfStudent(Student student);
}

--- 
+++ 
@@ -1,5 +1,6 @@
 package at.ac.tuwien.inso.service;
 
+import at.ac.tuwien.inso.controller.lecturer.GradeAuthorizationDTO;
 import at.ac.tuwien.inso.entity.*;
 import org.springframework.security.access.prepost.*;
 import org.springframework.stereotype.*;
@@ -10,10 +11,10 @@
 public interface GradeService {
 
     @PreAuthorize("hasRole('LECTURER')")
-    Grade getDefaultGradeForStudentAndCourse(Long studentId, Long courseId);
+    GradeAuthorizationDTO getDefaultGradeAuthorizationDTOForStudentAndCourse(Long studentId, Long courseId);
 
     @PreAuthorize("hasRole('LECTURER')")
-    Grade saveNewGradeForStudentAndCourse(Grade grade);
+    Grade saveNewGradeForStudentAndCourse(GradeAuthorizationDTO grade);
 
     @PreAuthorize("hasRole('LECTURER')")
     List<Grade> getGradesForCourseOfLoggedInLecturer(Long courseId);
@@ -25,4 +26,7 @@
 
     @PreAuthorize("isAuthenticated()")
     List<Grade> findAllOfStudent(Student student);
+
+    @PreAuthorize("isAuthenticated()")
+    List<Mark> getMarkOptions();
 }
Refactor for two factor authentification

