Class UsersAjaxController
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.ria.web.users.UsersAjaxController
-
@RestController @RequestMapping("/ajax/users") public class UsersAjaxController extends java.lang.Object
Handles asynchronous requests for the administration users table.
-
-
Constructor Summary
Constructors Constructor Description UsersAjaxController(UIUsersService uiUsersService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntity<AjaxResponse>
adminNewPasswordReset(java.lang.Long userId, java.security.Principal principal, java.util.Locale locale)
Create a newPasswordReset
for the givenUser
org.springframework.http.ResponseEntity<AjaxResponse>
changeUserPassword(java.lang.Long userId, java.lang.String oldPassword, java.lang.String newPassword, java.security.Principal principal, javax.servlet.http.HttpServletRequest request, java.util.Locale locale)
Change the password for a userorg.springframework.http.ResponseEntity<AjaxResponse>
createUser(UserCreateRequest userCreateRequest, java.security.Principal principal, java.util.Locale locale)
Create a new userorg.springframework.http.ResponseEntity<UserDetailsResponse>
getUserDetails(java.lang.Long userId, java.security.Principal principal)
Get the details for a specific userTableResponse<UserDetailsModel>
getUsersPagedList(AdminUsersTableRequest request)
Get a paged listing of users for the administration user.org.springframework.http.ResponseEntity<AjaxResponse>
updateUser(java.lang.Long userId, UserEditRequest userEditRequest, java.security.Principal principal, javax.servlet.http.HttpServletRequest request, java.util.Locale locale)
Submit a user editorg.springframework.http.ResponseEntity<AjaxResponse>
updateUserStatus(java.lang.Long id, boolean isEnabled, java.util.Locale locale)
Update a user status (if the user is enabled within IRIDA).
-
-
-
Constructor Detail
-
UsersAjaxController
@Autowired public UsersAjaxController(UIUsersService uiUsersService)
-
-
Method Detail
-
getUsersPagedList
@RequestMapping("/list") public TableResponse<UserDetailsModel> getUsersPagedList(@RequestBody AdminUsersTableRequest request)
Get a paged listing of users for the administration user. This can be filtered and sorted.- Parameters:
request
- - the information about the current page of users to return- Returns:
TableResponse
-
createUser
@RequestMapping(value="/create", method=POST) public org.springframework.http.ResponseEntity<AjaxResponse> createUser(@RequestBody UserCreateRequest userCreateRequest, java.security.Principal principal, java.util.Locale locale)
Create a new user- Parameters:
userCreateRequest
- aUserCreateRequest
containing details about a specific userprincipal
- a reference to the logged in userlocale
- the logged in user's request locale- Returns:
- the id of the new user
-
updateUserStatus
@RequestMapping("/edit") public org.springframework.http.ResponseEntity<AjaxResponse> updateUserStatus(@RequestParam java.lang.Long id, @RequestParam boolean isEnabled, java.util.Locale locale)
Update a user status (if the user is enabled within IRIDA).
-
updateUser
@RequestMapping(value="/{userId}/edit", method=POST) public org.springframework.http.ResponseEntity<AjaxResponse> updateUser(@PathVariable java.lang.Long userId, @RequestBody UserEditRequest userEditRequest, java.security.Principal principal, javax.servlet.http.HttpServletRequest request, java.util.Locale locale)
Submit a user edit- Parameters:
userId
- The id of the user to edit (required)userEditRequest
- aUserEditRequest
containing details about a specific userprincipal
- a reference to the logged in userrequest
- the requestlocale
- the logged in user's request locale- Returns:
- a status message
-
changeUserPassword
@RequestMapping(value="/{userId}/changePassword", method=POST) public org.springframework.http.ResponseEntity<AjaxResponse> changeUserPassword(@PathVariable java.lang.Long userId, @RequestParam(required=false) java.lang.String oldPassword, @RequestParam java.lang.String newPassword, java.security.Principal principal, javax.servlet.http.HttpServletRequest request, java.util.Locale locale)
Change the password for a user- Parameters:
userId
- The id of the user to edit (required)oldPassword
- The old password of the user for password changenewPassword
- The new password of the user for password changeprincipal
- a reference to the logged in userrequest
- the requestlocale
- the logged in user's request locale- Returns:
- a status message
-
getUserDetails
@RequestMapping("/{userId}") public org.springframework.http.ResponseEntity<UserDetailsResponse> getUserDetails(@PathVariable("userId") java.lang.Long userId, java.security.Principal principal)
Get the details for a specific user- Parameters:
userId
- - the id for the user to show details forprincipal
- - the currently logged in user- Returns:
- a
UserDetailsResponse
containing the details for a specific user
-
adminNewPasswordReset
@RequestMapping(value="/{userId}/reset-password", method=POST) @PreAuthorize("hasAnyRole(\'ROLE_ADMIN\', \'ROLE_MANAGER\')") public org.springframework.http.ResponseEntity<AjaxResponse> adminNewPasswordReset(@PathVariable java.lang.Long userId, java.security.Principal principal, java.util.Locale locale)
Create a newPasswordReset
for the givenUser
- Parameters:
userId
- The ID of theUser
principal
- a reference to the logged in user.locale
- a reference to the locale specified by the browser.- Returns:
- text to display to the user about the result of creating a password reset.
-
-