aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/line_footnotes_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/line_footnotes_controller.rb')
-rw-r--r--app/controllers/line_footnotes_controller.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/controllers/line_footnotes_controller.rb b/app/controllers/line_footnotes_controller.rb
index 305a8fac3..3b44d087c 100644
--- a/app/controllers/line_footnotes_controller.rb
+++ b/app/controllers/line_footnotes_controller.rb
@@ -1,6 +1,6 @@
class LineFootnotesController < ChouetteController
defaults :resource_class => Chouette::Line, :instance_name => 'line'
- before_action :check_policy, :only => [:edit, :update]
+ before_action :check_policy, only: [:edit, :update, :destroy]
belongs_to :referential
def show
@@ -23,11 +23,12 @@ class LineFootnotesController < ChouetteController
end
end
- private
+ protected
def check_policy
- authorize resource, :update_footnote?
+ authorize resource, "#{action_name}_footnote?".to_sym
end
+ private
def resource
@referential = Referential.find params[:referential_id]
@line = @referential.lines.find params[:line_id]