From 1294f721755f415b9212fda82e4f40179c0921d4 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 25 Mar 2012 19:32:05 +0000 Subject: 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 --- app/models/issue.rb | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'app') diff --git a/app/models/issue.rb b/app/models/issue.rb index ee394a87b..f85ddfec4 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -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 -- cgit v1.2.3