]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/redactions/show.html.erb
Merge remote-tracking branch 'upstream/pull/2381'
[rails.git] / app / views / redactions / show.html.erb
index a87cca604fd9c220a66fb07d22d24786e3c0fb99..1eb20f16f1564ce0350d51bb5f3d802a0822d72e 100644 (file)
   <%= @redaction.description.to_html %>
 </div>
 
-<% if current_user and current_user.moderator? %>
+<% if can?(:edit, Redaction) || can?(:destroy, Redaction) %>
 <div class="buttons">
-  <%= button_to t(".edit"), edit_redaction_path(@redaction), :method => :get %></td>
-  <%= button_to t(".destroy"), @redaction, :method => "delete", :remote => true, :data => { :confirm => t(".confirm") } %>
+  <% if can?(:edit, Redaction) %>
+    <%= button_to t(".edit"), edit_redaction_path(@redaction), :method => :get %></td>
+  <% end %>
+  <% if can?(:destroy, Redaction) %>
+    <%= button_to t(".destroy"), @redaction, :method => "delete", :remote => true, :data => { :confirm => t(".confirm") } %>
+  <% end %>
 </div>
 <% end %>