Project

General

Profile

Actions

Feature #21562

open

Add a permission to prevent user delete issues attachments.

Feature #21562: Add a permission to prevent user delete issues attachments.

Added by Hang Xie almost 11 years ago. Updated almost 10 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Attachments
Target version:
-
Resolution:

Description

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


Related issues 2 (2 open — 0 closed)

Related to Redmine - Feature #9358: Issue attachment permissionsNewActions
Has duplicate Redmine - Patch #24623: Implements CRUD permissions and restrictions to issue attachmentsNewActions

Updated by Hang Xie almost 11 years ago Actions #1

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,

Updated by Go MAEDA almost 11 years ago Actions #2

Updated by Frederico Camara almost 10 years ago Actions #3

Patch for Redmine 3.1, 3.2, 3.3 at #24623

Updated by Mischa The Evil almost 10 years ago Actions #4

  • Has duplicate Patch #24623: Implements CRUD permissions and restrictions to issue attachments added
Actions

Also available in: PDF Atom