-
Notifications
You must be signed in to change notification settings - Fork 25
Unable to set FileSet-level permissions: Hyrax 5 (latest), Bulkrax 9.3.3, Fedora 6 #1096
Description
This is related to #1092 but involves different logic in the Hyrax app, so I'm creating a separate issue.
With Bulkrax and Hyrax 3.x, it was possible to upload a work and a fileset with the fileset having more restrictive permissions/visibility than the parent work. This does not seem possible with Bulkrax and Hyrax 5. In my testing, the fileset automatically inherits the work's visibility, despite being explicitly set otherwise in the ingest CSV.
I believe the reason for this bug resides in a mismatch between Bulkrax's behavior and that of the Hyrax::WorkUploadsHandler.make_file_set_and_ingest method, which is invoked by the update_work.add_file_sets change set step.
The file_set_params hash contains the visibility settings on the fileset from the Bulkrax CSV import. However, the file_set_extra_params method looks for a key of :uploaded_file_id in the aforementioned hash, whereas coming from Bulkrax, that hash contains only a list of file ids under the key :uploaded_files. Not finding any uploaded_file_id's, the file_set_extra_params method returns an empty hash, and the check for additional visibility settings here fails.
Should Bulkrax pass an uploaded_file_id field in file_set_params? Or should Hyrax try to match the uploaded file ID both on that key and, if that match fails, on the values in the uploaded_files list?