Class CourseStaffController

java.lang.Object
edu.ucsb.cs.scaffold.controller.ApiController
edu.ucsb.cs.scaffold.controller.CourseStaffController

@RequestMapping("/api/coursestaff") @RestController public class CourseStaffController extends ApiController
  • Constructor Details

    • CourseStaffController

      public CourseStaffController()
  • Method Details

    • postCourseStaff

      @PreAuthorize("@CourseSecurity.hasInstructorPermissions(#root, #courseId)") @PostMapping("/post") public CourseStaff postCourseStaff(@RequestParam String firstName, @RequestParam String lastName, @RequestParam String email, @RequestParam Long courseId) throws EntityNotFoundException
      This method creates a new CourseStaff.
      Returns:
      the created CourseStaff
      Throws:
      EntityNotFoundException
    • courseStaffForCourse

      @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") @GetMapping("/course") public Iterable<CourseStaff> courseStaffForCourse(@RequestParam Long courseId) throws EntityNotFoundException
      This method returns a list of course staff for a given course.
      Returns:
      a list of all courses.
      Throws:
      EntityNotFoundException
    • updateStaffMember

      @PreAuthorize("@CourseSecurity.hasInstructorPermissions(#root, #courseId)") @PutMapping("") public CourseStaff updateStaffMember(@RequestParam Long courseId, @RequestParam Long id, @RequestParam String firstName, @RequestParam String lastName) throws EntityNotFoundException
      Throws:
      EntityNotFoundException
    • deleteStaffMember

      @PreAuthorize("@CourseSecurity.hasInstructorPermissions(#root, #courseId)") @DeleteMapping("/delete") @Transactional public org.springframework.http.ResponseEntity<String> deleteStaffMember(@RequestParam Long id, @RequestParam Long courseId) throws EntityNotFoundException
      Throws:
      EntityNotFoundException