Bug #570
Can't delete downloadable file from version in project with no issue tracker
Status: | New | Start date: | 2013-01-29 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | - | % Done: | 0% | |
Category: | - | |||
Target version: | - |
Description
If a project has a file for download, and that file is associated with a version within the project, and the project does not have the issue tracker module enabled, then the file cannot be deleted, not even by an admin user.
This is because:
in acts_as_attachable.rb
def attachments_deletable?(user=User.current) (respond_to?(:visible?) ? visible?(user) : true) && user.allowed_to?(self.class.attachable_options[:delete_permission], self.project) end
i.e. first test if the version is visible to the user, but in version.rb
def visible?(user=User.current) user.allowed_to?(:view_issues, self.project) end
which only succeeds if issues are enabled.
History
#1
Updated by Chris Cannam about 12 years ago
(It's interesting that the version returning false for "visible?" does not actually seem to prevent anyone from seeing the version.)