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

refactor PermisionsController to use load_resource #4951

Merged
merged 2 commits into from
May 11, 2021

Conversation

no-reply
Copy link
Contributor

@no-reply no-reply commented May 11, 2021

use CanCanCan's load_resource to resolve the resource in
PermissionsController. this has the advantage of centralizing the choice of
model 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

tamsin johnson added 2 commits May 11, 2021 00:04
use CanCanCan's `load_resource` to resolve the resource in
`PermissionsController`. this has the advantage of centralizing the choice of
model 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.
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.
@no-reply no-reply changed the title Permissions controller refactor PermisionsController to use load_resource May 11, 2021
@straleyb straleyb merged commit 479a2b9 into main May 11, 2021
@straleyb straleyb deleted the permissions-controller branch May 11, 2021 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PermissionsController needs to support valkyrie objects
2 participants