Package se.bth.pulse.controller
Class UserAdminRestController
java.lang.Object
se.bth.pulse.controller.UserAdminRestController
This class is a rest controller that serves the user admin page.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity
disableUser
(Integer id) Used to disable a user permanently.org.springframework.http.ResponseEntity
editUser
(Integer id, String firstname, String lastname, String email, String phonenr, Boolean credentialsExpired) Used to update the users profile.
-
Constructor Details
-
UserAdminRestController
-
-
Method Details
-
editUser
@PostMapping("/api/admin/user/edit") public org.springframework.http.ResponseEntity editUser(Integer id, String firstname, String lastname, String email, String phonenr, Boolean credentialsExpired) Used to update the users profile. The user is retrieved from the user repository using the id. The user firstname, lastname, email, phonenr and credentialsExpired are updated. To make the user change password the credentialsExpired is set to true.- Parameters:
id
- - the id of the user to be editedfirstname
- - the new firstname of the userlastname
- - the new lastname of the useremail
- - the new email of the userphonenr
- - the new phonenr of the usercredentialsExpired
- - the new credentialsExpired of the user- Returns:
- ResponseEntity - the response entity containing a success message if the user
-
disableUser
@PostMapping("/api/admin/user/disable/{id}") public org.springframework.http.ResponseEntity disableUser(@PathVariable("id") Integer id) Used to disable a user permanently.- Parameters:
id
- - the id of the user to be enabled- Returns:
- ResponseEntity - the response entity containing a success message if the user
-