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 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) instead
      Get 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 filtering
      logins - login string(s) for filtering
      firstNames - firstname string(s) for filtering
      lastNames - lastname string(s) for filtering
      eMails - email string(s) for filtering
      groupIds - group id(s) for filtering
      search - additionally search in users logins, firstNames, lastNames and emails
      sortBy - name of an attribute to sort
      sortOrder - sort order
      addGroups - 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.
      Saves 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 save
      jsonData - 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 @Path("/me/data") @Produces("application/json") UserDataResponse 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 by
      • id
      • login
      • firstName
      • lastName
      • email
      and sorted by
      • id
      • login
      • firstName
      • lastName
      • email
      Parameters:
      filter - filter parameters
      sorting - sorting parameters
      paging - paging parameters
      perms - perms parameters
      embed - 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 ID
      embed - optionally embed the referenced object (group)
      Returns:
      user response
      Throws:
      Exception
    • update

      @PUT @Path("/{id}") UserLoadResponse update(@PathParam("id") String id, User item) throws Exception
      Update user with given ID
      Parameters:
      id - local user ID
      item - 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 by
      • id
      • name
      and sorted by
      • id
      • name
      Parameters:
      id - local user ID
      filter - filter parameters
      sorting - sorting parameters
      paging - paging parameters
      perms - 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 ID
      groupId - 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 ID
      groupId - 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 ID
      groupId - 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 ID
      groupId - group ID
      nodeId - 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 ID
      groupId - group ID
      nodeId - node ID
      Returns:
      response containing the (possible updated) node restrictions
      Throws:
      Exception