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

[Admin] Ensure action_name is passed as symbol for cancancan authorization #5399

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Convert action_name to symbol for CanCanCan authorization
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.
  • Loading branch information
rainerdema committed Oct 6, 2023
commit cef7d9e6cbc243d395ab75f8c29752bcb95848ad
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def authorize_solidus_admin_user!
subject = authorization_subject

authorize! :admin, subject
authorize! action_name, subject
authorize! action_name.to_sym, subject
end

def authorization_subject
Expand Down