Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow RevokeEditToMembersJob to receive either an AF object or a Valkyrie resource as the Work #4103

Closed
elrayle opened this issue Oct 21, 2019 · 1 comment
Assignees
Labels

Comments

@elrayle
Copy link
Contributor

elrayle commented Oct 21, 2019

Descriptive summary

Convert RevokeEditToMembersJob to allow it to receive either an ActiveFedora based FileSet or a Valkyrie::Resource equivalent Work.

Rationale

Allow jobs to execute correctly with existing AF implementation or the wings Valkyrie implementation.

Expected behavior

RevokeEditToMembersJob receives a Valkyrie::Resource and performs RevokeEditJob for each member FileSet.

To get the list of FileSet ids from a work resource, use...

file_set_ids = Hyrax.query_service.custom_queries.find_child_fileset_ids(resource: work_resource)

Coordinate with Issue #4106 to pass use_valkyrie: true when a Valkyrie::Resource was received and false if not.

Actual behavior

RevokeEditToMembersJob raises an exception (perhaps: NoMethodFound for #search_with_conditions) when passed a Valkyrie::Resource.

Approach for Conversion

See Pattern for Jobs Receiving Parameter that may be an AF Object or a Valkyrie Resource

Steps to reproduce the behavior

  1. Need to add tests that validate that the same tests pass whether a Valkyrie::Resource or an AF object is passed.

See example of processing both objects in... file_set_actor_spec.rb

For testing this job, you can use something like...

RSpec.describe RevokeEditToMembersJob do
  [true, false].each do |test_valkyrie|
    context "when test_valkyrie is #{test_valkyrie}" do
      let(:af_work) { create(:work) }
      let(:valk_file_set) { af_work.valkyrie_resource }
      let(:work) { test_valkyrie ? valk_file_set : af_work }

Related work

@elrayle elrayle added the wings label Oct 21, 2019
@elrayle elrayle self-assigned this Oct 21, 2019
afred added a commit that referenced this issue Oct 21, 2019
Allows jobs that revoke edit permissions from file set objects and from file sets
that are members of a work to use Valkyrie.

Refs #4102
Refs #4103
elrayle pushed a commit that referenced this issue Oct 22, 2019
Allows jobs that revoke edit permissions from file set objects and from file sets
that are members of a work to use Valkyrie.

Refs #4102
Refs #4103
no-reply pushed a commit that referenced this issue Oct 24, 2019
Allows jobs that revoke edit permissions from file set objects and from file sets
that are members of a work to use Valkyrie.

Refs #4102
Refs #4103
@elrayle
Copy link
Contributor Author

elrayle commented Oct 25, 2019

Fixed by PR #4123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant