samvera-deprecated / curation_concerns

A Hydra-based Rails Engine that extends an application, adding the ability to Create, Read, Update and Destroy (CRUD) objects (based on Hydra::Works) and providing a generator for defining object types with custom workflows, views, access controls, etc.
Other
15 stars 27 forks source link

Make assign_visibility work with symbol hash keys #1046

Closed mkorcy closed 8 years ago

mkorcy commented 8 years ago

create_metadata may ignore file_set_params

I would expect to be able to set the visibility of a file_set as followes

ds_actor = CurationConcerns::Actors::FileSetActor.new(file_set, user)
ds_actor.create_metadata(obj, {visibility: Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE})

However, because the hash keys are compared as strings in the private method assign_visibility, this example fails to match and thus visibility is always inherited from the parent rather than assigned. Initially, I considered changing the comparison to just compare symbols, %i{} but there are other tests that fail because there are other occasions where hash keys are passed as Strings.

Changes proposed in this pull request:

@projecthydra/sufia-code-reviewers

escowles commented 8 years ago

👍