samvera-deprecated / sufia

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

New works don't save any added editors #3130

Closed hortongn closed 7 years ago

hortongn commented 7 years ago

Descriptive summary

This exists in 7.3.0.rc3

While creating a new work if you add another user as an editor and then save the work, the editor is not saved. Editors can be successfully added to an existing work, but not to a new work.

Steps to reproduce the behavior

  1. Start a new work and add needed metadata
  2. click the Share tab
  3. add a different user as an editor
  4. save the work
  5. edit that same work
  6. click the share tab again to see that the user you added is not there

When adding an editor, the different behavior between new works and existing works may be due to this: https://github.com/projecthydra/sufia/blob/master/app/actors/sufia/apply_permission_template_actor.rb#L10-L17

hortongn commented 7 years ago

@jcoyne Reopening because the bug still exists after your PR. Edit users are still only saved on work edit, not work create.

If I'm logged in as user2@example.com and create a new work with user1@example.com as an editor, after I save the work and look at edit_users in the console it only has ["user2@example.com"]

jcoyne commented 7 years ago

@hortongn are you using a mediated deposit workflow that has a custom action to removes all the edit users?

hortongn commented 7 years ago

@jcoyne Nope. This is just with a current Sufia master test app. Haven't done anything with workflows.

jcoyne commented 7 years ago

It's probably GrantEditToDepositor. https://github.com/projecthydra/curation_concerns/blob/9ebfe9b5061123f868ae5e61323007e00ab0a616/app/services/curation_concerns/workflow/grant_edit_to_depositor.rb#L7

hortongn commented 7 years ago

@jcoyne Yep, good catch. That's the problem for sure. I can take a stab at fixing that.