action aliases used in definition of abilities
#946

Assignees

Labels

Projects

Milestone

1 participant

I've run into a small issue where a dev on the team used an action alias in the abilities.rb file to define the abilities for a particular user. In this case, it was :index defined as an alias for :read (pretty standard stuff).

However, from what I can tell, CanCan searches for aliases in one direction but not the other, so in this case, when a controller checked can? :read, Object, it missed the alias.

I'd think that the can? function should check in both directions for an alias (ie alias to value, and values to their aliases).

I'll investigate and see if I can make that mod myself and post a pull request.