Interface GroupResource


@Path("/group") public interface GroupResource
Resource to get groups
  • Method Details

    • load

      @GET @Path("/load") GroupsResponse load(@BeanParam PermsParameterBean perms)
      Load the groups the user may see
      Parameters:
      perms - permissions parameters
      Returns:
      response containing groups
    • list

      @GET @Path("/list") @Deprecated GroupsResponse list(@QueryParam("skipCount") @DefaultValue("0") Integer skipCount, @QueryParam("maxItems") @DefaultValue("-1") Integer maxItems, @QueryParam("id") List<Integer> ids, @QueryParam("name") List<String> names, @QueryParam("memberlogin") List<String> memberLogins, @QueryParam("memberid") List<Integer> memberIds, @QueryParam("children") List<Integer> childGroupIds, @QueryParam("folder") List<Integer> privFolderIds, @QueryParam("privileges") List<Privilege> privileges, @QueryParam("reduce") GroupReduceType reduce, @QueryParam("sortby") GroupSortAttribute sortBy, @QueryParam("sortorder") @DefaultValue("asc") SortOrder sortOrder, @BeanParam PermsParameterBean perms)
      Get a list of groups, optionally filtered sorted and paged.
      Parameters:
      skipCount - number of groups skipped in the list (paging)
      maxItems - maximum number of groups returned (paging)
      ids - id of the group to return (filter)
      names - name or name pattern of the group(s) to return (filter)
      memberLogins - login name of the group member for the group(s) to return (filter)
      memberIds - id of the group member for the group(s) to return (filter)
      childGroupIds - ids of child groups for the group(s) to return (filter)
      privFolderIds - ids of folders for filtering by folder permissions (together with "privileges")
      privileges - list of privileges for filtering by folder permissions (together with "folder")
      reduce - if set, the list of groups will be reduced: for nested groups, only parent group(s) or child group(s) will be returned
      sortBy - name of the sorted attribute (sorting)
      sortOrder - sortorder (sorting)
      perms - permissions parameters
      Returns:
      response containing the groups
    • list

      @GET GroupList list(@BeanParam FilterParameterBean filter, @BeanParam SortParameterBean sorting, @BeanParam PagingParameterBean paging, @BeanParam PermsParameterBean perms) throws Exception
      List groups.
      The result can be filtered by
      • id
      • name
      • description
      and sorted by
      • id
      • name
      • description
      Parameters:
      filter - filter parameters
      sorting - sorting parameters
      paging - paging parameters
      perms - permissions parameters
      Returns:
      list of groups
      Throws:
      Exception
    • get

      @GET @Path("/{id}") GroupLoadResponse get(@PathParam("id") String id) throws Exception
      Load group with given ID
      Parameters:
      id - local group ID
      Returns:
      group response
      Throws:
      Exception
    • subgroups

      @GET @Path("/{id}/groups") GroupList subgroups(@PathParam("id") String id, @BeanParam FilterParameterBean filter, @BeanParam SortParameterBean sorting, @BeanParam PagingParameterBean paging, @BeanParam PermsParameterBean perms) throws Exception
      List subgroups of the given group.
      The result can be filtered by
      • id
      • name
      • description
      and sorted by
      • id
      • name
      • description
      Parameters:
      id - local group ID
      filter - filter parameters
      sorting - sorting parameters
      paging - paging parameters
      perms - permissions parameters
      Returns:
      list of subgroups
      Throws:
      Exception
    • add

      @PUT @Path("/{id}/groups") GroupLoadResponse add(@PathParam("id") String id, Group group) throws Exception
      Create subgroup
      Parameters:
      id - local group ID
      group - group
      Returns:
      created group
      Throws:
      Exception
    • move

      @PUT @Path("/{id}/groups/{subgroupId}") GroupLoadResponse move(@PathParam("id") String id, @PathParam("subgroupId") String subgroupId) throws Exception
      Move subgroup
      Parameters:
      id - local mother group ID
      group - group
      Returns:
      created group
      Throws:
      Exception
    • delete

      @DELETE @Path("/{id}") javax.ws.rs.core.Response delete(@PathParam("id") String id) throws Exception
      Delete a group
      Parameters:
      id - local group ID
      Returns:
      empty response
      Throws:
      Exception
    • update

      @POST @Path("/{id}") GroupLoadResponse update(@PathParam("id") String id, Group group) throws Exception
      Update a group
      Parameters:
      id - local group ID
      group - new group data
      Returns:
      updated group
      Throws:
      Exception
    • users

      @GET @Path("/{id}/users") UserList users(@PathParam("id") String id, @BeanParam FilterParameterBean filter, @BeanParam SortParameterBean sorting, @BeanParam PagingParameterBean paging, @BeanParam PermsParameterBean perms, @BeanParam EmbedParameterBean embed) throws Exception
      List users of given group.
      The result can be filtered by
      • id
      • login
      • firstName
      • lastName
      • email
      and sorted by
      • id
      • login
      • firstName
      • lastName
      • email
      Parameters:
      id - local group ID
      filter - filter parameters
      sorting - sorting parameters
      paging - paging parameters
      perms - permissions parameters
      embed - optionally embed the referenced objects (group)
      Returns:
      list of group members
      Throws:
      Exception
    • createUser

      @PUT @Path("/{id}/users") UserLoadResponse createUser(@PathParam("id") String id, User user) throws Exception
      Create user in the given group
      Parameters:
      id - local group ID
      user - user to create
      Returns:
      created user
      Throws:
      Exception
    • addUser

      @PUT @Path("/{id}/users/{userId}") UserLoadResponse addUser(@PathParam("id") String id, @PathParam("userId") String userId) throws Exception
      Add existing user to the given group
      Parameters:
      id - local group ID
      userId - local user ID
      Returns:
      user
      Throws:
      Exception
    • removeUser

      @DELETE @Path("/{id}/users/{userId}") javax.ws.rs.core.Response removeUser(@PathParam("id") String id, @PathParam("userId") String userId) throws Exception
      Remove user from a group
      Parameters:
      id - local group ID
      userId - local user ID
      Returns:
      empty response
      Throws:
      Exception
    • getPerms

      @GET @Path("/{id}/perms") TypePermissionList getPerms(@PathParam("id") String id, @QueryParam("parentType") String parentType, @QueryParam("parentId") Integer parentId, @QueryParam("channelId") Integer channelId) throws Exception
      Get permissions set for a group. If no parentType is given, only root-level permissions will be returned. Otherwise, the permissions on child types/instances of the given parentType/parentId will be returned.
      Parameters:
      id - group ID
      parentType - optional parent type
      parentId - optional parent ID
      channelId - optional channel ID
      Returns:
      Permissions response
      Throws:
      Exception
    • getTypePerms

      @GET @Path("/{id}/perms/{type}") TypePermissionResponse getTypePerms(@PathParam("id") String id, @PathParam("type") String type) throws Exception
      Get type permissions for a group
      Parameters:
      id - group ID
      type - type
      Returns:
      Permissions response
      Throws:
      Exception
    • setTypePerms

      @POST @Path("/{id}/perms/{type}") GenericResponse setTypePerms(@PathParam("id") String id, @PathParam("type") String type, @QueryParam("wait") @DefaultValue("0") long waitMs, TypePermissionRequest request) throws Exception
      Set type permissions for a group
      Parameters:
      id - group ID
      type - type
      waitMs - wait timeout in milliseconds
      request - request
      Returns:
      response
      Throws:
      Exception
    • getInstancePerms

      @GET @Path("/{id}/perms/{type}/{instanceId}") TypePermissionResponse getInstancePerms(@PathParam("id") String id, @PathParam("type") String type, @PathParam("instanceId") Integer instanceId) throws Exception
      Get instance permissions for a group
      Parameters:
      id - group ID
      type - type
      instanceId - instance ID
      Returns:
      Permissions response
      Throws:
      Exception
    • setInstancePerms

      @POST @Path("/{id}/perms/{type}/{instanceId}") GenericResponse setInstancePerms(@PathParam("id") String id, @PathParam("type") String type, @PathParam("instanceId") Integer instanceId, @QueryParam("wait") @DefaultValue("0") long waitMs, TypePermissionRequest request) throws Exception
      Set instance permissions for a group
      Parameters:
      id - group ID
      type - type
      instanceId - instance ID
      waitMs - wait timeout in milliseconds
      request - request
      Returns:
      response
      Throws:
      Exception