Interface UserResource
@Path("/user")
public interface UserResource
Resource to get Users. The list of users returned will always be filtered by
user permission: A user may only see users that are members of the same
groups or subgroups of the groups, the user is member of
-
Method Summary
Modifier and TypeMethodDescriptionaddGroupNodeRestriction
(String id, String groupId, String nodeId) Add node restriction to the assignment of the user to the groupaddToGroup
(String id, String groupId) Add user to the groupjavax.ws.rs.core.Response
deactivate
(String id) Deactivate the user with given IDdeleteUserData
(String key) Delete the user data for the given keyget
(String id, EmbedParameterBean embed) Load user with given IDGet complete user datagetGroupNodeRestrictions
(String id, String groupId) Get node restrictions for the assignment of the user to the groupgetMe
(boolean groups) Get the current user (me) By default, the user's groups are not returned.getUserData
(String key) Get user data for the given keygroups
(String id, FilterParameterBean filter, SortParameterBean sorting, PagingParameterBean paging, PermsParameterBean perms) List groups of given user.
The result can be filtered byid
name
and sorted byid
name
list
(FilterParameterBean filter, SortParameterBean sorting, PagingParameterBean paging, PermsParameterBean perms, EmbedParameterBean embed) List users.
The result can be filtered byid
login
firstName
lastName
email
and sorted byid
login
firstName
lastName
email
list
(Integer skipCount, Integer maxItems, List<Integer> ids, List<String> logins, List<String> firstNames, List<String> lastNames, List<String> eMails, List<Integer> groupIds, String search, UserSortAttribute sortBy, SortOrder sortOrder, boolean addGroups) Deprecated.because new endpoint exists.javax.ws.rs.core.Response
removeFromGroup
(String id, String groupId) Remove user from the groupremoveGroupNodeRestriction
(String id, String groupId, String nodeId) Remove node restriction from the assignment of the user to the groupsave
(Integer id, UserSaveRequest request) Deprecated.UsePUT /rest/user/{id}
insteadsaveUserData
(String key, com.fasterxml.jackson.databind.JsonNode jsonData) Save user data for the given keyUpdate user with given ID
-
Method Details
-
getMe
@GET @Path("/me") UserLoadResponse getMe(@QueryParam("groups") @DefaultValue("false") boolean groups) Get the current user (me) By default, the user's groups are not returned.- Parameters:
groups
- Whether to list the user's groups- Returns:
- current user
-
list
@GET @Path("/list") @Deprecated UserListResponse list(@QueryParam("skipCount") @DefaultValue("0") Integer skipCount, @QueryParam("maxItems") @DefaultValue("-1") Integer maxItems, @QueryParam("id") List<Integer> ids, @QueryParam("login") List<String> logins, @QueryParam("firstname") List<String> firstNames, @QueryParam("lastname") List<String> lastNames, @QueryParam("email") List<String> eMails, @QueryParam("group") List<Integer> groupIds, @QueryParam("search") String search, @QueryParam("sortby") UserSortAttribute sortBy, @QueryParam("sortorder") @DefaultValue("asc") SortOrder sortOrder, @QueryParam("groups") @DefaultValue("false") boolean addGroups) Deprecated.because new endpoint exists. use#list(FilterParameterBean, SortParameterBean, PagingParameterBean, PermsParameterBean)
insteadGet a list of users, optionally filtered, sorted and paged- Parameters:
skipCount
- number of elements to be skipped (paging)maxItems
- maximum number of elements returned (paging)ids
- id(s) for filteringlogins
- login string(s) for filteringfirstNames
- firstname string(s) for filteringlastNames
- lastname string(s) for filteringeMails
- email string(s) for filteringgroupIds
- group id(s) for filteringsearch
- additionally search in users logins, firstNames, lastNames and emailssortBy
- name of an attribute to sortsortOrder
- sort orderaddGroups
- true to add groups to the users, false (default) otherwise- Returns:
- list of users
-
save
@POST @Path("/save/{id}") @Deprecated GenericResponse save(@PathParam("id") Integer id, UserSaveRequest request) Deprecated.UsePUT /rest/user/{id}
insteadSaves the user into GCN.- Parameters:
id
- Id of the user to save.request
- user save request- Returns:
- GenericResponse
-
saveUserData
@POST @Path("/me/data/{key}") @Consumes("application/json") @Produces("application/json") GenericResponse saveUserData(@PathParam("key") String key, com.fasterxml.jackson.databind.JsonNode jsonData) Save user data for the given key- Parameters:
key
- key of the user data to savejsonData
- user data in JSON format- Returns:
- Generic response
-
getUserData
@GET @Path("/me/data/{key}") @Produces("application/json") UserDataResponse getUserData(@PathParam("key") String key) Get user data for the given key- Parameters:
key
- key of the user data- Returns:
- Response containing the value
-
deleteUserData
@DELETE @Path("/me/data/{key}") @Produces("application/json") GenericResponse deleteUserData(@PathParam("key") String key) Delete the user data for the given key- Parameters:
key
- key of the user data- Returns:
- Generic response
-
getAllUserData
Get complete user data- Returns:
- Response containing the complete user data
-
list
@GET UserList list(@BeanParam FilterParameterBean filter, @BeanParam SortParameterBean sorting, @BeanParam PagingParameterBean paging, @BeanParam PermsParameterBean perms, @BeanParam EmbedParameterBean embed) throws Exception List users.
The result can be filtered byid
login
firstName
lastName
email
id
login
firstName
lastName
email
- Parameters:
filter
- filter parameterssorting
- sorting parameterspaging
- paging parametersperms
- perms parametersembed
- optionally embed the referenced object (group)- Returns:
- user list
- Throws:
Exception
- in case of errors
-
get
@GET @Path("/{id}") UserLoadResponse get(@PathParam("id") String id, @BeanParam EmbedParameterBean embed) throws Exception Load user with given ID- Parameters:
id
- local user IDembed
- optionally embed the referenced object (group)- Returns:
- user response
- Throws:
Exception
-
update
Update user with given ID- Parameters:
id
- local user IDitem
- new user data- Returns:
- updated user
- Throws:
Exception
-
deactivate
@DELETE @Path("/{id}") javax.ws.rs.core.Response deactivate(@PathParam("id") String id) throws Exception Deactivate the user with given ID- Parameters:
id
- local user ID- Returns:
- empty response
- Throws:
Exception
-
groups
@GET @Path("/{id}/groups") GroupList groups(@PathParam("id") String id, @BeanParam FilterParameterBean filter, @BeanParam SortParameterBean sorting, @BeanParam PagingParameterBean paging, @BeanParam PermsParameterBean perms) throws Exception List groups of given user.
The result can be filtered byid
name
id
name
- Parameters:
id
- local user IDfilter
- filter parameterssorting
- sorting parameterspaging
- paging parametersperms
- permissions parameters- Returns:
- list of groups
- Throws:
Exception
-
addToGroup
@PUT @Path("/{id}/groups/{groupId}") GroupLoadResponse addToGroup(@PathParam("id") String id, @PathParam("groupId") String groupId) throws Exception Add user to the group- Parameters:
id
- local user IDgroupId
- local group ID- Returns:
- group
- Throws:
Exception
-
removeFromGroup
@DELETE @Path("/{id}/groups/{groupId}") javax.ws.rs.core.Response removeFromGroup(@PathParam("id") String id, @PathParam("groupId") String groupId) throws Exception Remove user from the group- Parameters:
id
- local user IDgroupId
- local group ID- Returns:
- empty response
- Throws:
Exception
-
getGroupNodeRestrictions
@GET @Path("/{id}/groups/{groupId}/nodes") NodeRestrictionResponse getGroupNodeRestrictions(@PathParam("id") String id, @PathParam("groupId") String groupId) throws Exception Get node restrictions for the assignment of the user to the group- Parameters:
id
- user IDgroupId
- group ID- Returns:
- response containing the node restrictions
- Throws:
Exception
-
addGroupNodeRestriction
@PUT @Path("/{id}/groups/{groupId}/nodes/{nodeId}") NodeRestrictionResponse addGroupNodeRestriction(@PathParam("id") String id, @PathParam("groupId") String groupId, @PathParam("nodeId") String nodeId) throws Exception Add node restriction to the assignment of the user to the group- Parameters:
id
- user IDgroupId
- group IDnodeId
- node ID- Returns:
- response containing the (possibly updated) node restrictions
- Throws:
Exception
-
removeGroupNodeRestriction
@DELETE @Path("/{id}/groups/{groupId}/nodes/{nodeId}") NodeRestrictionResponse removeGroupNodeRestriction(@PathParam("id") String id, @PathParam("groupId") String groupId, @PathParam("nodeId") String nodeId) throws Exception Remove node restriction from the assignment of the user to the group- Parameters:
id
- user IDgroupId
- group IDnodeId
- node ID- Returns:
- response containing the (possible updated) node restrictions
- Throws:
Exception
-