Project

General

Profile

Patch #8768 » Редактирование_комментариев_не_позже_4_часов_controller.patch

Journal_controller - Alexander Kulemin, 2011-07-08 09:56

View differences:

journal.rb (working copy)
59 59
  end
60 60
  
61 61
  def editable_by?(usr)
62
    usr && usr.logged? && (usr.allowed_to?(:edit_issue_notes, project) || (self.user == usr && usr.allowed_to?(:edit_own_issue_notes, project)))
62
#    usr && usr.logged? && (usr.allowed_to?(:edit_issue_notes, project) || (self.user == usr && usr.allowed_to?(:edit_own_issue_notes, project)))
63
    ##user can change his comment only if it was created in 4 hours before now (if user have only 	:edit_own_issue_notes)
64
    usr && usr.logged? && (usr.allowed_to?(:edit_issue_notes, project) || (self.user == usr && usr.allowed_to?(:edit_own_issue_notes, project) && ((Time.now - self.created_on) < 14400)))
63 65
  end
64 66
  
65 67
  def project
(2-2/2)