Class UserController

java.lang.Object
app.valuationcontrol.webservice.user.UserController

@RestController public class UserController extends Object
  • Constructor Details

    • UserController

      public UserController(UserRepository userRepository, EntityService entityService)
      Initializes the User controller and establish link to database Creator function that ensures that the model is connected to a document
  • Method Details

    • getModels

      @GetMapping("/api/user/models") @ResponseBody public org.springframework.http.ResponseEntity<UserData> getModels(Principal principal)
    • getUserModelAccess

      @GetMapping("/api/model/{modelId}/users") @PreAuthorize("authentication.principal.hasModelRole(#model,\'READER\')") @ResponseBody public org.springframework.http.ResponseEntity<List<UserAccessData>> getUserModelAccess(@PathVariable("modelId") Model model, Principal principal)
    • addUserToModel

      @PutMapping(value="/api/model/{modelId}/role/{role}", consumes="application/json") @PreAuthorize("authentication.principal.hasModelRole(#model,\'ADMIN\')") public org.springframework.http.ResponseEntity<Long> addUserToModel(@PathVariable("modelId") Model model, @PathVariable("role") User.MODEL_ROLE role, @Valid @RequestBody @Valid Email email, Principal principal)
    • removeUserModelRole

      @DeleteMapping("/api/model/{modelId}/user/{userId}") @PreAuthorize("authentication.principal.hasModelRole(#model,\'ADMIN\')") public org.springframework.http.ResponseEntity<Void> removeUserModelRole(@PathVariable("modelId") Model model, @PathVariable Long userId, Principal principal)