From 9a8ddef8dbfec3ac656b0980a1614b8720e6a950 Mon Sep 17 00:00:00 2001 From: Guillaume Date: Tue, 28 Nov 2017 15:44:16 +0100 Subject: Refs #4824, #4825 fix error line_decorator --- app/decorators/line_decorator.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/decorators/line_decorator.rb b/app/decorators/line_decorator.rb index ee35cd85e..ede670cbd 100644 --- a/app/decorators/line_decorator.rb +++ b/app/decorators/line_decorator.rb @@ -21,7 +21,7 @@ class LineDecorator < Draper::Decorator href: [context[:line_referential], object.company] ) - if h.policy(Chouette::Line).update? && + if h.policy(Chouette::Line).create? && context[:line_referential].organisations.include?( context[:current_organisation] ) @@ -48,6 +48,8 @@ class LineDecorator < Draper::Decorator method: :delete, data: {confirm: h.t('lines.actions.destroy_confirm')} ) + end + links end end -- cgit v1.2.3