Contract for isNotMemberOf
searches for Groups and EPersons
#241
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(Replaces #237)
Required by DSpace/DSpace#9052 and DSpace/dspace-angular#2512
Description
In order to fix the performance issues described in the above tickets, we need a way to search across all Groups and all EPersons which are not yet a member of a specific Group in the system.
Therefore, this PR suggests two new REST API endpoints:
GET /api/eperson/groups/search/isNotMemberOf?group=<:uuid>&query=<:string>
group=<:uuid>
./api/eperson/groups/<:uuid>/subgroups
endpoint for that Group specified bygroup=<:uuid>
GET /api/eperson/epersons/search/isNotMemberOf?group=<:uuid>&query=<:string>
group=<:uuid>
./api/eperson/groups/<:uuid>/epersons
endpoint for that Group specified bygroup=<:uuid>
Additional Details on Performance Issue
These new endpoints are required to fix the behavior issues in the Angular UI code. Currently, our Angular UI includes code which requests every EPerson in a Group or every Subgroup in a Group in order to determine whether a given EPerson or Group is already included in a given parent Group.
For example:
isMemberOfGroup
inmembers-list.component.ts
: https://github.com/DSpace/dspace-angular/blob/main/src/app/access-control/group-registry/group-form/members-list/members-list.component.ts#L216C1-L233C3isSubgroupOfGroup
insubgroups-list.component.ts
: https://github.com/DSpace/dspace-angular/blob/main/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts#L138-L159This UI behavior will cause performance issues when a Group has a large number of members (either EPerson or Subgroup).
This performance issue will be fixed by now creating performance-friendly endpoints to find non-members.