Package org.dspace.app.rest
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 -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChildGroups(UUID uuid, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.http.HttpServletRequest request) Method to add one or more subgroups to a group.voidaddMembers(UUID uuid, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.http.HttpServletRequest request) Method to add one or more members to a group.voidremoveChildGroup(UUID parentUUID, UUID childUUID, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.http.HttpServletRequest request) Method to remove a subgroup from a group.voidremoveMember(UUID parentUUID, UUID memberUUID, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.http.HttpServletRequest request) Method to remove a member from a group.
-
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:
SQLExceptionAuthorizeException
-
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:
SQLExceptionAuthorizeException
-
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 groupchildUUID- the uuid of the subgroup which has to be removed- Throws:
IOExceptionSQLExceptionAuthorizeException
-
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 groupmemberUUID- the uuid of the member which has to be removed- Throws:
IOExceptionSQLExceptionAuthorizeException
-