check correct permission before destroying

pull/6827/head
Markus Kahl 8 years ago
parent 4de3d1f557
commit 702eb5fdad
  1. 2
      lib/report/controller.rb

@ -95,7 +95,7 @@ module Report::Controller
# RecordNotFound if the query at :id does not exist
def destroy
if @query
@query.destroy if allowed_to? :delete, @query
@query.destroy if allowed_to? :destroy, @query
else
raise ActiveRecord::RecordNotFound
end

Loading…
Cancel
Save