If no users are specified in access.owned_by, then the AccessComponent just takes the identity that's supplied to the service operations (e.g. create) and adds that as owner.
https://github.com/inveniosoftware/invenio-rdm-records/blob/master/invenio_rdm_records/services/components.py#L56
This silently assumes that there exists a user with the given Identity's ID -- which may not always be true however, e.g. when the SystemIdentity is used (which has the ID "system", instead of a user's integer ID).
Package version (if known): 0.27.9
Describe the bug
If no users are specified in
access.owned_by
, then the AccessComponent just takes theidentity
that's supplied to the service operations (e.g.create
) and adds that as owner. https://github.com/inveniosoftware/invenio-rdm-records/blob/master/invenio_rdm_records/services/components.py#L56 This silently assumes that there exists a user with the given Identity's ID -- which may not always be true however, e.g. when theSystemIdentity
is used (which has the ID"system"
, instead of a user's integer ID).An example where this happens is the
demo
CLI command, that uses the system identity to create records: https://github.com/inveniosoftware/invenio-rdm-records/blob/master/invenio_rdm_records/cli.py#L229