diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-11-11 15:07:55 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-11-11 15:07:55 +0000 |
commit | 7a05f8ed66918e13315e647ecea620a716c4cbeb (patch) | |
tree | cb5098c39034e87ee3a22df22da2da087a29c6c8 /app/views | |
parent | cbacc71dff75f6abd6bfc5c4c4200b6c08528e0a (diff) | |
download | redmine-7a05f8ed66918e13315e647ecea620a716c4cbeb.tar.gz redmine-7a05f8ed66918e13315e647ecea620a716c4cbeb.zip |
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
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/messages/show.rhtml | 8 |
1 files changed, 4 insertions, 4 deletions
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 @@ <div class="contextual"> <%= 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) %> </div> <h2><%=h @topic.subject %></h2> @@ -25,8 +25,8 @@ <a name="<%= "message-#{message.id}" %>"></a> <div class="contextual"> <%= 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) %> </div> <div class="message reply"> <h4><%=h message.subject %> - <%= authoring message.created_on, message.author %></h4> |