Dear all,
I have a question regarding the update of entities in ICAT via the REST entityManager endpoint.
I'm trying to update the title of an Investigation using
a user with CRU flags on the Investigation table, and I'm running into
two issues depending on what I send.
Case 1: partial payload
-> 412 error, OBJECT_ALREADY_EXISTS
I guess there is a conflict with the unique constraint on (FACILITY_ID, NAME, VISIT_ID).
Case 2: full payload
-> 403 error INSUFFICIENT_PRIVILEGES
ICAT treats the update as a delete+recreate of the relationship, which requires DELETE permission. Is it expected?
Case 3: Updating it via soap works.
See attached a script , and the results:
=== Test 1: without facility => 412 OBJECT_ALREADY_EXISTS ===
EXPECTED FAILURE: 412 -
{"code":"OBJECT_ALREADY_EXISTS","message":"Investigation exists with
facility = 'Facility:305', name = 'ID002606', visitId =
'ID00'","offset":0}
=== Test 2: with facility => 403 INSUFFICIENT_PRIVILEGES ===
EXPECTED FAILURE: 403 -
{"code":"INSUFFICIENT_PRIVILEGES","message":"DELETE access implied by
UPDATE to this Investigation is not allowed.","offset":0}
=== Test 3: SOAP update => succeeds ===
SUCCESS: SOAP update worked
Am I doing something wrong? Is this a known limitation of the REST entityManager?
Thanks a lot for your help,
All the best,
Marjolaine
.py, it gets blocked.id field, then it is treated as an update. If not, it is treated as a create.DELETE access implied by UPDATE to this " + klass.getSimpleName() + " is not allowed.