Class 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addChildGroups​(UUID uuid, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpServletRequest request)
      Method to add one or more subgroups to a group.
      void addMembers​(UUID uuid, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpServletRequest request)
      Method to add one or more members to a group.
      void removeChildGroup​(UUID parentUUID, UUID childUUID, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpServletRequest request)
      Method to remove a subgroup from a group.
      void removeMember​(UUID parentUUID, UUID memberUUID, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpServletRequest request)
      Method to remove a member from a group.
    • Constructor Detail

      • GroupRestController

        public GroupRestController()
    • Method Detail

      • addChildGroups

        @PreAuthorize("hasAuthority(\'AUTHENTICATED\')")
        @RequestMapping(method=POST,
                        path="/{uuid}/subgroups",
                        consumes="text/uri-list")
        public void addChildGroups​(@PathVariable
                                   UUID uuid,
                                   javax.servlet.http.HttpServletResponse response,
                                   javax.servlet.http.HttpServletRequest request)
                            throws SQLException,
                                   org.dspace.authorize.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
        org.dspace.authorize.AuthorizeException
      • addMembers

        @PreAuthorize("hasAuthority(\'AUTHENTICATED\')")
        @RequestMapping(method=POST,
                        path="/{uuid}/epersons",
                        consumes="text/uri-list")
        public void addMembers​(@PathVariable
                               UUID uuid,
                               javax.servlet.http.HttpServletResponse response,
                               javax.servlet.http.HttpServletRequest request)
                        throws SQLException,
                               org.dspace.authorize.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
        org.dspace.authorize.AuthorizeException
      • removeChildGroup

        @PreAuthorize("hasAuthority(\'AUTHENTICATED\')")
        @RequestMapping(method=DELETE,
                        path="/{parentUUID}/subgroups/{childUUID}")
        public void removeChildGroup​(@PathVariable
                                     UUID parentUUID,
                                     @PathVariable
                                     UUID childUUID,
                                     javax.servlet.http.HttpServletResponse response,
                                     javax.servlet.http.HttpServletRequest request)
                              throws IOException,
                                     SQLException,
                                     org.dspace.authorize.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
        org.dspace.authorize.AuthorizeException
      • removeMember

        @PreAuthorize("hasAuthority(\'AUTHENTICATED\')")
        @RequestMapping(method=DELETE,
                        path="/{parentUUID}/epersons/{memberUUID}")
        public void removeMember​(@PathVariable
                                 UUID parentUUID,
                                 @PathVariable
                                 UUID memberUUID,
                                 javax.servlet.http.HttpServletResponse response,
                                 javax.servlet.http.HttpServletRequest request)
                          throws IOException,
                                 SQLException,
                                 org.dspace.authorize.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
        org.dspace.authorize.AuthorizeException