diff options
author | Marius Balteanu <marius.balteanu@zitec.com> | 2021-08-05 23:50:11 +0000 |
---|---|---|
committer | Marius Balteanu <marius.balteanu@zitec.com> | 2021-08-05 23:50:11 +0000 |
commit | f31a1e2bbbb74ed3e184c5b280900298d25d58ab (patch) | |
tree | e4b2ae2108f194bb033c2e6c75dc4f7ff5a3fd80 /app | |
parent | 1146831b3dec4cc801d078bfc58bed1ec8d49c52 (diff) | |
download | redmine-f31a1e2bbbb74ed3e184c5b280900298d25d58ab.tar.gz redmine-f31a1e2bbbb74ed3e184c5b280900298d25d58ab.zip |
Fixed attachments deletable by user without edit issue permission on tracker (#35634).
git-svn-id: http://svn.redmine.org/redmine/trunk@21142 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/models/issue.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index 09f8400cc..7ce04ad64 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -209,6 +209,11 @@ class Issue < ActiveRecord::Base user_tracker_permission?(user, :delete_issues) end + # Overrides Redmine::Acts::Attachable::InstanceMethods#attachments_deletable? + def attachments_deletable?(user=User.current) + attributes_editable?(user) + end + def initialize(attributes=nil, *args) super if new_record? |