feat: add collaborators as requestors - #1234
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces “collaborators” for negotiations so additional users can edit/transfer negotiations and manage collaborators (with removal restricted to the author), and updates filtering/access rules to treat collaborators as requestors.
Changes:
- Backend: adds negotiation↔collaborator persistence, API endpoints, access checks, and query filtering to include collaborators.
- Frontend: adds UI to add/list/remove collaborators in the negotiation sidebar.
- Tests & fixtures: expands integration/controller tests and test seed data to cover collaborator behavior.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/views/NegotiationPage.vue | Wires sidebar events up to page-level handlers (currently only logging). |
| frontend/src/components/NegotiationSidebar.vue | Adds collaborator UI (add button, collaborator list, removal modal) and API calls to fetch/remove collaborators. |
| frontend/src/components/modals/AddCollaboratorModal.vue | New modal to add collaborators by Subject ID via API. |
| frontend/src/components/AddCollaboratorButton.vue | New button component to open the add-collaborator modal and bubble events up. |
| backend/src/test/java/eu/bbmri_eric/negotiator/negotiation/NegotiationControllerTests.java | Adds tests for collaborator transfer and collaborator CRUD endpoints. |
| backend/src/test/java/eu/bbmri_eric/negotiator/integration/api/v3/UserControllerTest.java | Updates expectations for user search due to new collaborator seed user. |
| backend/src/main/resources/db/test/migration/R__Initial_data.sql | Seeds a collaborator user and a negotiation↔collaborator link for tests. |
| backend/src/main/resources/db/migration/V36.0__add_negotiation_collaborators.sql | Adds the join table for negotiation collaborators. |
| backend/src/main/java/eu/bbmri_eric/negotiator/negotiation/NegotiationSpecification.java | Includes collaborator membership in negotiation filtering for requestor views. |
| backend/src/main/java/eu/bbmri_eric/negotiator/negotiation/NegotiationServiceImpl.java | Adds collaborator operations and collaborator-aware write-access checks. |
| backend/src/main/java/eu/bbmri_eric/negotiator/negotiation/NegotiationService.java | Extends service API with collaborator operations and collaborator status checks. |
| backend/src/main/java/eu/bbmri_eric/negotiator/negotiation/NegotiationRepository.java | Adds repository method to check collaborator membership. |
| backend/src/main/java/eu/bbmri_eric/negotiator/negotiation/NegotiationController.java | Adds REST endpoints for listing/adding/removing collaborators and treats collaborators as requestors on retrieve. |
| backend/src/main/java/eu/bbmri_eric/negotiator/negotiation/NegotiationAccessManagerImpl.java | Extends read/update access to include collaborators. |
| backend/src/main/java/eu/bbmri_eric/negotiator/negotiation/Negotiation.java | Adds the collaborators ManyToMany association and helper add/remove methods. |
stetsche
left a comment
There was a problem hiding this comment.
Nice work, looks pretty good, just a minor suggestion. If needed, please run frontend formatter also.
|
|



Description:
Users can now be added as collaborators to a negotiation, allowing them to edit the negotiation and invite additional collaborators. When a negotiation is transferred to a collaborator, the existing collaborator access link is automatically terminated. Only the negotiation author has permission to remove other collaborators.
Checklist:
Make sure you tick all the boxes below if they are true or do not apply before you ask for review
Required for all pull requests:
If applicable to this PR: