summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2021-07-27 20:42:32 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2021-07-27 20:42:32 +0000
commit27dde49df44c13a7d9c6a5ddef096cdc3fb42a75 (patch)
tree43dadf2b3296985a53cb8810e0f27b109234c86b /app
parent1613c3193c7dda686980bc0552c236c84f11d315 (diff)
downloadredmine-27dde49df44c13a7d9c6a5ddef096cdc3fb42a75.tar.gz
redmine-27dde49df44c13a7d9c6a5ddef096cdc3fb42a75.zip
Merged r21081 to 4.2-stable (#34856).
git-svn-id: http://svn.redmine.org/redmine/branches/4.2-stable@21093 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/models/time_entry.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/time_entry.rb b/app/models/time_entry.rb
index cb852e218..b5926c612 100644
--- a/app/models/time_entry.rb
+++ b/app/models/time_entry.rb
@@ -119,6 +119,13 @@ class TimeEntry < ActiveRecord::Base
self.project_id = issue.project_id
end
@invalid_issue_id = nil
+ elsif user.allowed_to?(:log_time, issue.project) && issue.assigned_to_id_changed? && issue.previous_assignee == User.current
+ current_assignee = issue.assigned_to
+ issue.assigned_to = issue.previous_assignee
+ unless issue.visible?(user)
+ @invalid_issue_id = issue_id
+ end
+ issue.assigned_to = current_assignee
else
@invalid_issue_id = issue_id
end