Skip to content

authorize_resource is not called on the index action #1233

@westonganger

Description

@westonganger

I was trying to implement my usual methods for CanCan but I was stumped for a bit why the authorize_resource method was never getting called no matter what I did.

Turns out that authorize_resource is never called on the index action which happened to be the page I was testing.

https://github.com/thoughtbot/administrate/blob/master/app/controllers/administrate/application_controller.rb#L5

I was expecting the method to called with the resource_class in place of the resource. I suppose this could pass the scoped_resource instead if that is preferred.

Would you accept a PR for this? If not then the documentation should be updated to include this little tidbit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugbreakages in functionality that is implementedsecuritycontrolling data access through authorisation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions