samvera-deprecated / sufia

[DEPRECATED] Sufia: a fully featured, flexible Samvera repository front-end.
http://sufia.io/
Other
111 stars 78 forks source link

Adding second manager removes edit_access of first manager #3148

Open elrayle opened 7 years ago

elrayle commented 7 years ago

Descriptive summary

When adding a Manager to an Admin Set, the Manager user gets edit_access to the Admin Set. When you add a second Manager to the Admin Set, the first user, who is still a manager, no longer has edit_access. The second Manager does have edit_access.

Expected behavior

When the second Manager is added, both managers will have edit_access to the Admin Set, as seen in the solr document for the Admin Set in Solr.

Actual behavior

When the second Manager is added, only the second Manager has edit_access to the Admin Set, as seen in the solr document for the Admin Set in Solr.

Steps to reproduce the behavior

Prerequisite: You will need 1 admin user and 2 non-admin users.

Primary Validation

  1. Create Admin Set
    1. Login as an admin user
    2. Create an Admin Set and Save
  2. Edit the Admin Set
    1. View the Admin Set's show page
    2. Edit the Admin Set
    3. Click the Participants tab
  3. Set the first Manager
    1. Add Participants -> Add user: -> set to non-admin user
    2. Set role to Manager
    3. Click Add button
    4. VERIFY: Check solr document for the new Admin Set in Solr and verify that the selected user is in the edit_access_person_ssim list.
  4. Set the second Manager
    1. Add Participants -> Add user: -> set to another non-admin user
    2. Set role to Manager
    3. Click Add button
    4. VERIFY: Check solr document for the new Admin Set in Solr and verify that only the second manager user is in the edit_access_person_ssim list.

EXPECTED: I would expect the edit_access_person_ssim to include both manager users.

Secondary Validation: Manager can edit metadata in an Admin Set

  1. Login as each Manager user
  2. Attempt to edit the Admin Set -- NOT AVAILABLE

I would expect that Managers of an Admin Set would be able to edit the metadata and set participants for an Admin Set. But I can't find a way through the UI for a non-admin user to edit Admin Sets.

Third Validation: Manager can add works to Admin Set

  1. Login as each Manager user
  2. In Top Menu, select Works -> New Work -> select work type
  3. In New Work form, select Relationships tab
  4. VERIFY: 'Add as member of administrative set' selection list includes the Admin Set

This verification is CORRECT for both users.

So something other than edit_access on the Admin Set is driving ability to select the Admin Set on New Work -> Relationships tab.

mjgiarlo commented 7 years ago

@elrayle is this with 7.3.0.rc1? master? another commit/tag?

elrayle commented 7 years ago

master

elrayle commented 7 years ago

I just noticed that it also removed the "edit_access_group_ssim":["admin"]. This gets set in the Solr doc when I create the new Admin Set, but is missing once I set the first Manager.

mjgiarlo commented 7 years ago

@elrayle Based on the discussion over on https://gist.github.com/mjgiarlo/1945fa8a6f50eef2f9268af34f34dd47, I am inclined to hide the Admin Set Managers and Admin Set Viewers in the participants form in Sufia master, since neither is implemented yet (and doing feature work is out of scope now that we're at rc3). I'll ticket this work to be done in Hyrax, and it may be backported for a subsequent Sufia release if someone wants this in Sufia 7. Given that we're hiding Admin Set Managers, I'd also like to copy this ticket to Hyrax. How do you feel about that?

mjgiarlo commented 7 years ago

@elrayle See:

jcoyne commented 7 years ago

Fixed in hyrax projecthydra-labs/hyrax#567

elrayle commented 7 years ago

Looks like the PermissionTemplateAccess is NOT created for each new manager. (I didn't verify the same applies for depositor and viewer, but suspect that it does.)

Clicking Remove button for a manager tries to remove the non-existent PermissionTemplateAccess, but doesn't even try to remove the edit_access from the solr doc.