@Path(value="/users") @Consumes(value="application/json") @Produces(value="application/json") public class UsersResource extends RestResource
| Modifier and Type | Field and Description |
|---|---|
protected static com.google.common.collect.ImmutableMap<String,SearchQueryField> |
SEARCH_FIELD_MAPPING |
configuration, userService| Constructor and Description |
|---|
UsersResource(UserManagementService userManagementService,
PaginatedUserService paginatedUserService,
AccessTokenService accessTokenService,
RoleService roleService,
MongoDBSessionService sessionService) |
| Modifier and Type | Method and Description |
|---|---|
void |
changePassword(String userId,
@Valid ChangePasswordRequest cr) |
void |
changeUser(String userId,
@Valid @NotNull ChangeUserRequest cr) |
javax.ws.rs.core.Response |
create(@Valid @NotNull CreateUserRequest cr) |
void |
deletePermissions(String username) |
void |
deleteUser(String username) |
void |
deleteUserById(String userId) |
void |
editPermissions(String username,
@Valid @NotNull PermissionEditRequest permissionRequest) |
Token |
generateNewToken(String userId,
String name,
String body) |
UserSummary |
get(String username,
UserContext userContext)
Deprecated.
|
UserSummary |
getbyId(String userId,
UserContext userContext) |
PaginatedResponse<UserOverviewDTO> |
getPage(int page,
int perPage,
String query,
String sort,
String order) |
TokenList |
listTokens(String userId) |
UserList |
listUsers()
Deprecated.
|
void |
revokeToken(String userId,
String idOrToken) |
void |
savePreferences(String username,
UpdateUserPreferences preferencesRequest) |
javax.ws.rs.core.Response |
updateAccountStatus(@NotBlank String userId,
@NotBlank String newStatusString,
UserContext userContext) |
checkAnyPermission, checkPermission, checkPermission, getCurrentUser, getIndexSet, getSubject, getUriBuilderToSelf, isAnyPermitted, isAnyPermitted, isPermitted, isPermitted, setPrettyPrintprotected static final com.google.common.collect.ImmutableMap<String,SearchQueryField> SEARCH_FIELD_MAPPING
@Inject public UsersResource(UserManagementService userManagementService, PaginatedUserService paginatedUserService, AccessTokenService accessTokenService, RoleService roleService, MongoDBSessionService sessionService)
@GET @Deprecated @Path(value="{username}") public UserSummary get(@PathParam(value="username") String username, @Context UserContext userContext)
@GET
@Path(value="id/{userId}")
public UserSummary getbyId(@PathParam(value="userId")
String userId,
@Context
UserContext userContext)
@GET @Deprecated public UserList listUsers()
@GET @Timed @Path(value="/paginated") @Produces(value="application/json") public PaginatedResponse<UserOverviewDTO> getPage(@QueryParam(value="page") @DefaultValue(value="1") int page, @QueryParam(value="per_page") @DefaultValue(value="50") int perPage, @QueryParam(value="query") @DefaultValue(value="") String query, @DefaultValue(value="full_name") @QueryParam(value="sort") String sort, @DefaultValue(value="asc") @QueryParam(value="order") String order)
@POST
public javax.ws.rs.core.Response create(@Valid @NotNull
@Valid @NotNull CreateUserRequest cr)
throws ValidationException
ValidationException@PUT
@Path(value="{userId}")
public void changeUser(@PathParam(value="userId")
String userId,
@Valid @NotNull
@Valid @NotNull ChangeUserRequest cr)
throws ValidationException
ValidationException@DELETE
@Path(value="{username}")
public void deleteUser(@PathParam(value="username")
String username)
@DELETE
@Path(value="id/{userId}")
public void deleteUserById(@PathParam(value="userId")
String userId)
@PUT
@Path(value="{username}/permissions")
public void editPermissions(@PathParam(value="username")
String username,
@Valid @NotNull
@Valid @NotNull PermissionEditRequest permissionRequest)
throws ValidationException
ValidationException@PUT
@Path(value="{username}/preferences")
public void savePreferences(@PathParam(value="username")
String username,
UpdateUserPreferences preferencesRequest)
throws ValidationException
ValidationException@DELETE
@Path(value="{username}/permissions")
public void deletePermissions(@PathParam(value="username")
String username)
throws ValidationException
ValidationException@PUT
@Path(value="{userId}/password")
public void changePassword(@PathParam(value="userId")
String userId,
@Valid
@Valid ChangePasswordRequest cr)
throws ValidationException
ValidationException@PUT
@Path(value="{userId}/status/{newStatus}")
@Consumes(value="*/*")
public javax.ws.rs.core.Response updateAccountStatus(@PathParam(value="userId") @NotBlank
@NotBlank String userId,
@PathParam(value="newStatus") @NotBlank
@NotBlank String newStatusString,
@Context
UserContext userContext)
throws ValidationException
ValidationException@GET
@Path(value="{userId}/tokens")
public TokenList listTokens(@PathParam(value="userId")
String userId)
@POST
@Path(value="{userId}/tokens/{name}")
public Token generateNewToken(@PathParam(value="userId")
String userId,
@PathParam(value="name")
String name,
String body)
Copyright © 2012–2021 Graylog, Inc.. All rights reserved.