Class UsersController

java.lang.Object
edu.ucsb.cs156.gauchoride.controllers.ApiController
edu.ucsb.cs156.gauchoride.controllers.UsersController

@RequestMapping("/api/admin/users") @RestController public class UsersController extends ApiController
  • Constructor Details

    • UsersController

      public UsersController()
  • Method Details

    • users

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @GetMapping("") public org.springframework.http.ResponseEntity<String> users() throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • users

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @GetMapping("/get") public User users(@RequestParam Long id) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • deleteUser_Admin

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @DeleteMapping("/delete") public Object deleteUser_Admin(@RequestParam Long id)
    • toggleAdmin

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PostMapping("/toggleAdmin") public Object toggleAdmin(@RequestParam Long id)
    • toggleDriver

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PostMapping("/toggleDriver") public Object toggleDriver(@RequestParam Long id)