-
-
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
[Admin] Ensure action_name
is passed as symbol for cancancan
authorization
#5399
[Admin] Ensure action_name
is passed as symbol for cancancan
authorization
#5399
Conversation
c2faa57
to
ae16e5a
Compare
cancancan
authorizationaction_name
is passed as symbol for cancancan
authorization
14f9f83
to
aa0a406
Compare
admin/app/controllers/solidus_admin/controller_helpers/authorization.rb
Outdated
Show resolved
Hide resolved
aa0a406
to
b06342d
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.
LGTM, just left a suggestion for adding some basic style to the error page
<h1><%= t('solidus_admin.errors.authorization.access_denied.title') %></h1> | ||
<p><%= t('solidus_admin.errors.authorization.access_denied.description') %></p> |
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.
Thoughts on adding some TW style to this so it fits in with the context?
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.
b06342d
to
c155a5f
Compare
Fix CanCanCan authorization by converting action_name to symbol. In the context of implementing permissions in the Solidus Demo, we identified that `action_name` in string format doesn't align with CanCanCan's `authorize!` method expectations. It needs to be in symbol format to be processed correctly. This change ensures our authorization logic functions as intended also for the new solidus admin views.
Enhance the SolidusAdmin authorization mechanism to improve user experience during unauthorized access attempts. Now, instead of previous behavior, users are redirected to a dedicated unauthorized page when attempting to access a resource for which they do not have permission.
c155a5f
to
dca1907
Compare
Summary
In the context of implementing permissions in the Solidus Demo, we identified that
action_name
in string format doesn't align with CanCanCan'sauthorize!
method expectations.It needs to be in symbol format to be processed correctly.
This change ensures our authorization logic functions as intended even for the new solidus admin views.
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: