Project

General

Profile

Feature #13814 » redmine-2.4.6-add_closed_issue_notes.patch

Michał Rzechonek, 2015-02-26 20:46

View differences:

app/models/issue.rb 2015-02-26 19:17:37.000000000 +0100 → app/models/issue.rb 2015-02-26 20:21:27.242222301 +0100
148 148

  
149 149
  # Returns true if user or current user is allowed to edit or add a note to the issue
150 150
  def editable?(user=User.current)
151
    user.allowed_to?(:edit_issues, project) || user.allowed_to?(:add_issue_notes, project)
151
    if self.closed?
152
        return user.allowed_to?(:add_closed_issue_notes, project)
153
    else
154
        return user.allowed_to?(:edit_issues, project) || user.allowed_to?(:add_issue_notes, project)
155
    end
152 156
  end
153 157

  
154 158
  def initialize(attributes=nil, *args)
lib/redmine.rb 2015-02-26 19:17:36.000000000 +0100 → lib/redmine.rb 2015-02-26 20:26:58.205225280 +0100
116 116
    map.permission :set_issues_private, {}
117 117
    map.permission :set_own_issues_private, {}, :require => :loggedin
118 118
    map.permission :add_issue_notes, {:issues => [:edit, :update, :update_form], :journals => [:new], :attachments => :upload}
119
    map.permission :add_closed_issue_notes, {:issues => [:edit, :update, :update_form], :journals => [:new], :attachments => :upload}
119 120
    map.permission :edit_issue_notes, {:journals => :edit}, :require => :loggedin
120 121
    map.permission :edit_own_issue_notes, {:journals => :edit}, :require => :loggedin
121 122
    map.permission :view_private_notes, {}, :read => true, :require => :member
(1-1/2)