We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3a706c1 commit 18b0b72Copy full SHA for 18b0b72
guides/authorization/pundit_integration.md
@@ -411,11 +411,11 @@ Here's an example of how the custom hooks can be installed:
411
```ruby
412
module CustomPolicyLookup
413
# Lookup policies in the `SystemAdmin::` namespace for system_admin users
414
+ # @return [Class]
415
def pundit_policy_class_for(object, context)
416
current_user = context[:current_user]
417
if current_user.system_admin?
- policy_class = SystemAdmin.const_get("#{object.class.name}Policy")
418
- policy_class.new(current_user, object)
+ SystemAdmin.const_get("#{object.class.name}Policy")
419
else
420
super
421
end
0 commit comments