Feature #21562

Add a permission to prevent user delete issues attachments.

Added by Hang Xie almost 2 years ago. Updated 10 months ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Attachments
Target version:-
Resolution:

Description

Now only the Wiki have “Delete attachments” permission, can add this permission to "Issue tracking" too?


Related issues

Related to Redmine - Feature #9358: Issue attachment permissions New 2011-09-30
Duplicated by Redmine - Patch #24623: Implements permissions and restrictions to issue attachments New

History

#1 Updated by Hang Xie almost 2 years ago

Now we use a ugly hack to make that only the admin can delete attachment:

diff --git a/app/views/attachments/_links.html.erb b/app/views/attachments/_links.html.erb
index 0804b80..bfe351d 100644
--- a/app/views/attachments/_links.html.erb
+++ b/app/views/attachments/_links.html.erb
@@ -13,7 +13,7 @@
   <% end %>
   <%= " - #{attachment.description}" unless attachment.description.blank? %>
   <span class="size">(<%= number_to_human_size attachment.filesize %>)</span>
-  <% if options[:deletable] %>
+  <% if User.current.admin? && options[:deletable] %>
     <%= link_to image_tag('delete.png'), attachment_path(attachment),
                                          :data => {:confirm => l(:text_are_you_sure)},
                                          :method => :delete,

#2 Updated by Go MAEDA almost 2 years ago

#3 Updated by Frederico Camara 10 months ago

Patch for Redmine 3.1, 3.2, 3.3 at #24623

#4 Updated by Mischa The Evil 10 months ago

  • Duplicated by Patch #24623: Implements permissions and restrictions to issue attachments added

Also available in: Atom PDF