@Path(value="/authz/roles") @Produces(value="application/json") public class AuthzRolesResource extends RestResource
| Modifier and Type | Field and Description |
|---|---|
protected static com.google.common.collect.ImmutableMap<String,SearchQueryField> |
SEARCH_FIELD_MAPPING |
protected static com.google.common.collect.ImmutableMap<String,SearchQueryField> |
USER_SEARCH_FIELD_MAPPING |
configuration| Constructor and Description |
|---|
AuthzRolesResource(PaginatedAuthzRolesService authzRolesService,
PaginatedUserService paginatedUserService,
UserService userService) |
| Modifier and Type | Method and Description |
|---|---|
void |
addUser(@NotBlank String roleId,
Set<String> usernames) |
void |
delete(@NotBlank String roleId) |
AuthzRoleDTO |
get(@NotBlank String roleId) |
PaginatedResponse<AuthzRoleDTO> |
getList(int page,
int perPage,
String query,
String sort,
String order) |
PaginatedResponse<AuthzRoleDTO> |
getListForUser(@NotEmpty String username,
int page,
int perPage,
String query,
String sort,
String order) |
PaginatedResponse<UserOverviewDTO> |
getUsersForRole(@NotEmpty String roleId,
int page,
int perPage,
String query,
String sort,
String order) |
void |
removeUser(@NotBlank String roleId,
@NotBlank String username) |
checkAnyPermission, checkPermission, checkPermission, getCurrentUser, getIndexSet, getSubject, getUriBuilderToSelf, isAnyPermitted, isAnyPermitted, isPermitted, isPermitted, setPrettyPrintprotected static final com.google.common.collect.ImmutableMap<String,SearchQueryField> SEARCH_FIELD_MAPPING
protected static final com.google.common.collect.ImmutableMap<String,SearchQueryField> USER_SEARCH_FIELD_MAPPING
@Inject public AuthzRolesResource(PaginatedAuthzRolesService authzRolesService, PaginatedUserService paginatedUserService, UserService userService)
@GET @Timed public PaginatedResponse<AuthzRoleDTO> getList(@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="name") @QueryParam(value="sort") String sort, @DefaultValue(value="asc") @QueryParam(value="order") String order)
@GET
@Path(value="/{roleId}/assignees")
@Produces(value="application/json")
public PaginatedResponse<UserOverviewDTO> getUsersForRole(@PathParam(value="roleId") @NotEmpty
@NotEmpty String roleId,
@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="name") @QueryParam(value="sort")
String sort,
@DefaultValue(value="asc") @QueryParam(value="order")
String order)
@GET
@Path(value="{roleId}")
@Produces(value="application/json")
public AuthzRoleDTO get(@PathParam(value="roleId") @NotBlank
@NotBlank String roleId)
@GET
@Path(value="/user/{username}")
public PaginatedResponse<AuthzRoleDTO> getListForUser(@PathParam(value="username") @NotEmpty
@NotEmpty String username,
@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="name") @QueryParam(value="sort")
String sort,
@DefaultValue(value="asc") @QueryParam(value="order")
String order)
@PUT
@Produces(value="application/json")
@Path(value="{roleId}/assignees")
public void addUser(@PathParam(value="roleId") @NotBlank
@NotBlank String roleId,
Set<String> usernames)
throws ValidationException
ValidationException@DELETE
@Path(value="{roleId}/assignee/{username}")
public void removeUser(@PathParam(value="roleId") @NotBlank
@NotBlank String roleId,
@PathParam(value="username") @NotBlank
@NotBlank String username)
throws ValidationException
ValidationException@DELETE
@Path(value="{roleId}")
@Produces(value="application/json")
public void delete(@PathParam(value="roleId") @NotBlank
@NotBlank String roleId)
Copyright © 2012–2021 Graylog, Inc.. All rights reserved.