hyrax
hyrax copied to clipboard
Resource permission persisting
Introduces handling of permissions_attributes
params that come from the controller in the SaveAccessControl
transaction step. The step converts the params into Hyrax::Permission
objects and adds them to the ACL of the object being saved.
Also in the PR is change to the works controller to pass the step arg to make use of this new functionality.
In support of #5797
Steps for testing:
- Go to dashboard
- Go to works
- Click Add new work button
- Fill in required metadata
- Go to Sharing tab
- Choose group 'admin' with 'Edit' access and click Add
- Click deposit agreement
- Click Save button
- Click Edit button
- Go to Sharing tab
- Look for group 'admin' in 'Currently Shared With' table
This is failing features/edit_work_resource_spec.rb because the permissions_attributes parameter is not including the agent.
@dlpierce Thanks. I made some changes to guard for missing params (probably due to unused fields on the page still being posted). This should be ready for review as long as CI goes green.
This fails when trying to edit a work and add a permission in koppie. It looks like Hyrax::PermissionController needs to change to Hyrax::Resource in its load_resource call. Strangely, when I setup the feature test to add a permission and save it, it does not fail when run in the koppie container.