diff options
| author | cedricnjanga | 2017-08-04 02:00:44 +0200 | 
|---|---|---|
| committer | cedricnjanga | 2017-08-04 02:00:44 +0200 | 
| commit | 154760f497eceb8e93e4f63cf16346d99c17d2d2 (patch) | |
| tree | ef9ee1094c3888ae9bbbde96a4971a822ce070a2 /app/decorators | |
| parent | 09b0d438c50c7cd9ec9c18d1d90c16877b07d9a9 (diff) | |
| download | chouette-core-154760f497eceb8e93e4f63cf16346d99c17d2d2.tar.bz2 | |
Refs #4227 Add timetable_combination policies
Diffstat (limited to 'app/decorators')
| -rw-r--r-- | app/decorators/time_table_decorator.rb | 14 | 
1 files changed, 8 insertions, 6 deletions
diff --git a/app/decorators/time_table_decorator.rb b/app/decorators/time_table_decorator.rb index 526537310..c6eeac176 100644 --- a/app/decorators/time_table_decorator.rb +++ b/app/decorators/time_table_decorator.rb @@ -21,13 +21,15 @@ class TimeTableDecorator < Draper::Decorator        )      end -    links << Link.new( -      content: h.t('actions.combine'), -      href: h.new_referential_time_table_time_table_combination_path( -        context[:referential], -        object +    if h.policy(object).edit? +      links << Link.new( +        content: h.t('actions.combine'), +        href: h.new_referential_time_table_time_table_combination_path( +          context[:referential], +          object +        )        ) -    ) +    end      if h.policy(object).duplicate?        links << Link.new(  | 
