refactor PermisionsController to use load_resource #4951
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
use CanCanCan's
load_resource
to resolve the resource inPermissionsController
. this has the advantage of centralizing the choice ofmodel class and persistence service to use.
to close #4917, we'll need to ensure the background jobs support Valkyrie, and
then switch to using
Hyrax::Resource
as the model to resolve.in specs: nest legacy AF models. remove some stubs in favor of real
actions. rework ActiveJob specs. drop specs for deprecated controller actions.
i think both Jobs support Valkyrie and AF models interchangeably. to bolster support: deprecate InheritPermissionsJob#perform use_valkyrie argument (c4a4b7f).
there's no convenient way to pass this parameter, and it would have needed to be
aligned with the model class passed. deprecate it and choose behavior based on
the model class provided instead.
@samvera/hyrax-code-reviewers