-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Remove CanCanCan custom actions aliases (cont.) #3701
Remove CanCanCan custom actions aliases (cont.) #3701
Conversation
dfa025b
to
7f37bed
Compare
7f37bed
to
2f94238
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@filippoliverani thank you 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@filippoliverani thanks! Just left one small comment about a typo. I'm also wondering if we should add a deprecation warning for accessible_by
calls?
2f94238
to
2bac604
Compare
2bac604
to
d114b81
Compare
Right, |
Legacy custom action aliases are translated to CanCanCan default aliases. A deprecation warning is raised every time a legacy custom alias is used. A warning is raised every time :read alias is used since its behavior had been customized (:show, :to => :read) and it's different from default CanCanCan behavior (index, :show, :to => :read).
d114b81
to
c92e13a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great change @filippoliverani! @coorasse do you have some time to leave your opinion here?
Description
This PR is a continuation of #3148
Current Solidus' CanCanCan custom action aliases are not needed anymore and can make maintaining permissions and upgrading to new versions of CanCanCan much harder.
This PR:
The new
use_custom_cancancan_actions
preference can be set tofalse
to ignore legacy custom aliases and to apply CanCanCan default aliases.If
use_custom_cancancan_actions
is set totrue
(default value for existing stores)::read
alias is used since its behavior had been customized (:show, :to => :read
) and it's different from default CanCanCan behavior (index, :show, :to => :read
).Checklist:
[ ] I have updated Guides and README accordingly to this change (if needed)[ ] I have added tests to cover this change (if needed)[ ] I have attached screenshots to this PR for visual changes (if needed)