Class GroupRestController

java.lang.Object
org.dspace.app.rest.GroupRestController

@RestController @RequestMapping("/api/eperson/groups") public class GroupRestController extends Object
This will be the entry point for the api/eperson/groups endpoint with additional paths to it
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addChildGroups(UUID uuid, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.http.HttpServletRequest request)
    Method to add one or more subgroups to a group.
    void
    addMembers(UUID uuid, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.http.HttpServletRequest request)
    Method to add one or more members to a group.
    void
    removeChildGroup(UUID parentUUID, UUID childUUID, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.http.HttpServletRequest request)
    Method to remove a subgroup from a group.
    void
    removeMember(UUID parentUUID, UUID memberUUID, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.http.HttpServletRequest request)
    Method to remove a member from a group.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GroupRestController

      public GroupRestController()
  • Method Details

    • addChildGroups

      @PreAuthorize("hasAuthority(\'AUTHENTICATED\')") @RequestMapping(method=POST, path="/{uuid}/subgroups", consumes="text/uri-list") public void addChildGroups(@PathVariable UUID uuid, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.http.HttpServletRequest request) throws SQLException, AuthorizeException
      Method to add one or more subgroups to a group. The subgroups to be added should be provided in the request body as a uri-list. Note that only the 'AUTHENTICATED' state will be checked in PreAuthorize, a more detailed check will be done by using the 'checkAuthorization' method.
      Parameters:
      uuid - the uuid of the group to add the subgroups to
      Throws:
      SQLException
      AuthorizeException
    • addMembers

      @PreAuthorize("hasAuthority(\'AUTHENTICATED\')") @RequestMapping(method=POST, path="/{uuid}/epersons", consumes="text/uri-list") public void addMembers(@PathVariable UUID uuid, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.http.HttpServletRequest request) throws SQLException, AuthorizeException
      Method to add one or more members to a group. The members to be added should be provided in the request body as a uri-list. Note that only the 'AUTHENTICATED' state will be checked in PreAuthorize, a more detailed check will be done by using the 'checkAuthorization' method.
      Parameters:
      uuid - the uuid of the group to add the members to
      Throws:
      SQLException
      AuthorizeException
    • removeChildGroup

      @PreAuthorize("hasAuthority(\'AUTHENTICATED\')") @RequestMapping(method=DELETE, path="/{parentUUID}/subgroups/{childUUID}") public void removeChildGroup(@PathVariable UUID parentUUID, @PathVariable UUID childUUID, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.http.HttpServletRequest request) throws IOException, SQLException, AuthorizeException
      Method to remove a subgroup from a group. Note that only the 'AUTHENTICATED' state will be checked in PreAuthorize, a more detailed check will be done by using the 'checkAuthorization' method.
      Parameters:
      parentUUID - the uuid of the parent group
      childUUID - the uuid of the subgroup which has to be removed
      Throws:
      IOException
      SQLException
      AuthorizeException
    • removeMember

      @PreAuthorize("hasAuthority(\'AUTHENTICATED\')") @RequestMapping(method=DELETE, path="/{parentUUID}/epersons/{memberUUID}") public void removeMember(@PathVariable UUID parentUUID, @PathVariable UUID memberUUID, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.http.HttpServletRequest request) throws IOException, SQLException, AuthorizeException
      Method to remove a member from a group. Note that only the 'AUTHENTICATED' state will be checked in PreAuthorize, a more detailed check will be done by using the 'checkAuthorization' method.
      Parameters:
      parentUUID - the uuid of the parent group
      memberUUID - the uuid of the member which has to be removed
      Throws:
      IOException
      SQLException
      AuthorizeException