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

Provide a custom authorization action on parent resources #115

Closed
phallguy opened this issue Aug 28, 2014 · 2 comments
Closed

Provide a custom authorization action on parent resources #115

phallguy opened this issue Aug 28, 2014 · 2 comments
Assignees

Comments

@phallguy
Copy link
Contributor

Currently, when authorizing nested resources, the parent resource is always authorized with the :show action. This makes a great deal of sense and is a good default but there are occasions when are more restrictive option is needed for more complex permissions.

I'd like to be able to specify the action that cancan uses to authorize the parent object as well

class Controller
  load_and_authorize_resource :library, parent: true, parent_action: :sort
end
phallguy added a commit to phallguy/cancancan that referenced this issue Aug 28, 2014
phallguy added a commit to phallguy/cancancan that referenced this issue Sep 4, 2014
@Senjai
Copy link
Member

Senjai commented Jun 13, 2015

@phallguy I know it's been a while, but I think this is a fair suggestion. Would you consider submitting a pull request?

@Senjai Senjai self-assigned this Jun 13, 2015
phallguy added a commit to phallguy/cancancan that referenced this issue Jun 13, 2015
@phallguy
Copy link
Contributor Author

Sure thing see #216

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants