inveniosoftware / invenio-records-resources

Records REST APIs for Invenio.
https://invenio-records-resources.readthedocs.io
MIT License
4 stars 48 forks source link

Unpublished Drafts a user has access to are not returned via /api/user/records #593

Open karkraeg opened 1 month ago

karkraeg commented 1 month ago

Is your feature request related to a problem? Please describe.

Hi, can one get information about unpublished drafts that a user has been granted access to via the API?

Say User A creates a new draft and uses the "Share" Button on the deposit form to grant access to User B. User B wont be able to find the draft anywhere, it's only accessible if they know the exact URL. It would be great if one could get the data via /api/user/records as it is for published records from other users one has access to.

The docs state that GET /api/user/records ist "Used for interacting with the records and drafts you can edit."

-> when a user has been granted access ("Can manage" in the Share access modal of a draft) by another user to a draft of this user the draft does in fact not show up via /api/user/records.

wgresshoff commented 2 weeks ago

I Think the problem is in invenio_rdm_records.services.search_params.MyDraftsParam: changing the search filter to "term", **{"is_published": False} yields the drafts to the users who have at least edit permission.