Class UsersController
java.lang.Object
edu.ucsb.cs156.frontiers.controllers.ApiController
edu.ucsb.cs156.frontiers.controllers.UsersController
@RequestMapping("/api/admin/users")
@RestController
public class UsersController
extends ApiController
This is a REST controller for getting information about the users.
These endpoints are only accessible to users with the role "ROLE_ADMIN".
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.data.domain.Page
<UserDataDTO> users
(org.springframework.data.domain.Pageable pageable) This method returns a list of all users.Methods inherited from class edu.ucsb.cs156.frontiers.controllers.ApiController
doesCurrentUserHaveRole, genericMessage, getCurrentUser, handleEntityNotFoundException, handleIllegalArgument, handleNoLinkedOrgException, handleUnsupportedOperation, isCurrentUserAdmin
-
Constructor Details
-
UsersController
public UsersController()
-
-
Method Details
-
users
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") @GetMapping("") public org.springframework.data.domain.Page<UserDataDTO> users(org.springframework.data.domain.Pageable pageable) throws com.fasterxml.jackson.core.JsonProcessingException This method returns a list of all users. Accessible only to users with the role "ROLE_ADMIN".- Returns:
- a list of all users
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
- if there is an error processing the JSON
-