diff options
author | Go MAEDA <maeda@farend.jp> | 2023-03-02 04:32:34 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2023-03-02 04:32:34 +0000 |
commit | 555acea7804e6a93b133fe7398f490cb083c05b2 (patch) | |
tree | f5a1471e7463a4c77cc99f36656c484e9215a114 /app/models/issue.rb | |
parent | 4dc56cd943b6cb5cfaae8bd21db2c8ef82e7a50c (diff) | |
download | redmine-555acea7804e6a93b133fe7398f490cb083c05b2.tar.gz redmine-555acea7804e6a93b133fe7398f490cb083c05b2.zip |
Check if the user has the permission to add notes or edit an issue when adding an issue attachments (#38297).
Patch by Holger Just.
git-svn-id: https://svn.redmine.org/redmine/trunk@22122 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r-- | app/models/issue.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index a0c2006ad..f267f3f48 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -199,6 +199,10 @@ class Issue < ActiveRecord::Base ) end + def attachments_addable?(user=User.current) + attributes_editable?(user) || notes_addable?(user) + end + # Overrides Redmine::Acts::Attachable::InstanceMethods#attachments_editable? def attachments_editable?(user=User.current) attributes_editable?(user) |