Merged r14795 and r14796 (#21150).

git-svn-id: http://svn.redmine.org/redmine/branches/3.0-stable@14838 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2015-11-08 08:56:55 +00:00
parent 32a1a803ab
commit 5bd5738750
3 changed files with 21 additions and 2 deletions

View File

@@ -69,7 +69,7 @@ class TimeEntry < ActiveRecord::Base
if attrs
attrs = super(attrs)
if issue_id_changed? && issue
if user.allowed_to?(:log_time, issue.project)
if issue.visible?(user) && user.allowed_to?(:log_time, issue.project)
if attrs[:project_id].blank? && issue.project_id != project_id
self.project_id = issue.project_id
end