hyrax icon indicating copy to clipboard operation
hyrax copied to clipboard

An admin's changes are not persisted on the Work Sharing tab when Admin Set does not allow access grants

Open bkiahstroud opened this issue 2 years ago • 3 comments

Descriptive summary

Admins always have access to the Sharing tab on the work form, even if the Admin Set the work is deposited in doesn't allow access grants. When an admin fills out the Add Sharing form and submits it, the UI indicates it submits successfully; however, the change does not get persisted.

This is because the permissions parameters get silently thrown out of the request if the admin set does not allow access grants (see WorkForm.sanitize_params).

This bug has been reproduced in HEAD (as of a0f8455) on Nurax.

Rationale

There is a mismatch in what the UI says the user has access to, and what the user can actually do. The UI should be consistent with the user's ability.

Expected behavior

Two options:

  1. An admin should not be able to see a work's sharing tab (or should get an error in the UI) if the work's admin set does not allow access grants
  2. An admin's changes to a work's sharing should persist, even if the work's admin set does not allow access grants

Actual behavior

An admin's changes to a work's sharing do not get persisted when the work's admin set does not allow access grants.

Steps to reproduce the behavior

  1. Login as an admin
  2. Create a new Admin Set with a mediated deposit workflow
  3. Deposit a new Work into the Admin Set created in step 2
  4. Edit the work
  5. Click on the Sharing tab
  6. Under "Add Sharing", select any group/user/access and click Add
  7. Click the "Save changes" button
  8. Edit the work again
  9. Click on the Sharing tab
  10. Verify the change you just made was not persisted under the "Currently Shared With" section

Related work

To my understanding, admins should always have access to the Sharing tab on the work form as evidenced by #4898. Does this mean the second option under Expected Behavior is the correct path forward?

bkiahstroud avatar Oct 25 '22 18:10 bkiahstroud

Question: what should the expected behavior be?

bkiahstroud avatar Oct 25 '22 18:10 bkiahstroud

As an admin user, I would expect to have access to the sharing tab regardless of the admin set settings, so option 2 seems to be the best way forward.

rjkati avatar Oct 25 '22 18:10 rjkati

Verified this is still happening in Hyrax 5.0.0 on the following work: https://dev.nurax.samvera.org/concern/generic_works/0v838086x?locale=en

This work is created in an admin set that uses mediated deposit workflow. The work is supposed to be shared with another user but that Add Sharing will not save.

jlhardes avatar Mar 18 '24 20:03 jlhardes