Skip to content

Commit

Permalink
Pass user (possibly nobody) to pundit
Browse files Browse the repository at this point in the history
In some views we try to do policy validation, however we do not
require authentication, therefore no user object is avaliable to pundit
which raises an exception (look app/policies/application_policy.rb)

Fixes #7743
  • Loading branch information
vpereira committed Jul 17, 2019
1 parent 8b43c06 commit d17237b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/app/controllers/webui/webui_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def check_ajax
end

def pundit_user
User.session! if User.session
User.possibly_nobody
end

# dialog_init is a function name called before dialog is shown
Expand Down

0 comments on commit d17237b

Please sign in to comment.