Fixed that issues can be moved to projects with issue tracking disabled (#10467).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9267 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
1 parent
5663ca89fa
commit
1294f72175
2 files changed
+10
-28
No files matched your search
+1
-12
@@ -800,18 +800,7 @@ class Issue < ActiveRecord::Base
|
||||
|
||||
# Returns an array of projects that user can move issues to
|
||||
def self.allowed_target_projects_on_move(user=User.current)
|
||||
projects = []
|
||||
if user.admin?
|
||||
# admin is allowed to move issues to any active (visible) project
|
||||
projects = Project.visible(user).all
|
||||
elsif user.logged?
|
||||
if Role.non_member.allowed_to?(:move_issues)
|
||||
projects = Project.visible(user).all
|
||||
else
|
||||
user.memberships.each {|m| projects << m.project if m.roles.detect {|r| r.allowed_to?(:move_issues)}}
|
||||
end
|
||||
end
|
||||
projects
|
||||
Project.all(:conditions => Project.allowed_to_condition(user, :move_issues))
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in new issue
Block a user