From 7a05f8ed66918e13315e647ecea620a716c4cbeb Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Tue, 11 Nov 2008 15:07:55 +0000 Subject: Adds permissions to let users edit and/or delete their messages (#854, patch by Markus Knittig with slight changes). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2019 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/messages/show.rhtml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/views') diff --git a/app/views/messages/show.rhtml b/app/views/messages/show.rhtml index 31696d56d..4143532b1 100644 --- a/app/views/messages/show.rhtml +++ b/app/views/messages/show.rhtml @@ -4,8 +4,8 @@
<%= watcher_tag(@topic, User.current) %> <%= link_to_remote_if_authorized l(:button_quote), { :url => {:action => 'quote', :id => @topic} }, :class => 'icon icon-comment' %> - <%= link_to_if_authorized l(:button_edit), {:action => 'edit', :id => @topic}, :class => 'icon icon-edit' %> - <%= link_to_if_authorized l(:button_delete), {:action => 'destroy', :id => @topic}, :method => :post, :confirm => l(:text_are_you_sure), :class => 'icon icon-del' %> + <%= link_to(l(:button_edit), {:action => 'edit', :id => @topic}, :class => 'icon icon-edit') if @message.editable_by?(User.current) %> + <%= link_to(l(:button_delete), {:action => 'destroy', :id => @topic}, :method => :post, :confirm => l(:text_are_you_sure), :class => 'icon icon-del') if @message.destroyable_by?(User.current) %>

<%=h @topic.subject %>

@@ -25,8 +25,8 @@ ">
<%= link_to_remote_if_authorized image_tag('comment.png'), { :url => {:action => 'quote', :id => message} }, :title => l(:button_quote) %> - <%= link_to_if_authorized image_tag('edit.png'), {:action => 'edit', :id => message}, :title => l(:button_edit) %> - <%= link_to_if_authorized image_tag('delete.png'), {:action => 'destroy', :id => message}, :method => :post, :confirm => l(:text_are_you_sure), :title => l(:button_delete) %> + <%= link_to(image_tag('edit.png'), {:action => 'edit', :id => message}, :title => l(:button_edit)) if message.editable_by?(User.current) %> + <%= link_to(image_tag('delete.png'), {:action => 'destroy', :id => message}, :method => :post, :confirm => l(:text_are_you_sure), :title => l(:button_delete)) if message.destroyable_by?(User.current) %>

<%=h message.subject %> - <%= authoring message.created_on, message.author %>

-- cgit v1.2.3