Class CourseOptionsController

java.lang.Object
edu.ucsb.cs156.frontiers.controllers.ApiController
edu.ucsb.cs156.frontiers.controllers.CourseOptionsController

@RequestMapping("/api/course/options") @RestController public class CourseOptionsController extends ApiController
  • Constructor Details

    • CourseOptionsController

      public CourseOptionsController()
  • Method Details

    • getCourseOptions

      @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") @GetMapping("") public Map<String,Boolean> getCourseOptions(@RequestParam Long courseId, @RequestParam(required=false) String option)
      The options are readable by anyone who can manage the course (its instructor, its staff and admins), because what the course pages show depends on them; they can only be changed by the instructor or an admin.
    • setCourseOption

      @PreAuthorize("@CourseSecurity.hasInstructorPermissions(#root, #courseId)") @PostMapping("") public Map<String,Boolean> setCourseOption(@RequestParam Long courseId, @RequestParam String option, @RequestParam Boolean enabled)