summaryrefslogtreecommitdiffstats
path: root/app/controllers/projects_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-11-14 21:54:16 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-11-14 21:54:16 +0000
commitb0a8888e356aa287fc9c968a5d9b05fc2aff0748 (patch)
tree25a0e1b36ad30fe85e6be57945588900802e1b1c /app/controllers/projects_controller.rb
parent833c7bd659fea1c7ce9f7bdd85714c4ac7f877d5 (diff)
downloadredmine-b0a8888e356aa287fc9c968a5d9b05fc2aff0748.tar.gz
redmine-b0a8888e356aa287fc9c968a5d9b05fc2aff0748.zip
Fixed: admin should be able to move issues to any project.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@903 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/projects_controller.rb')
-rw-r--r--app/controllers/projects_controller.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index e708dd6fc..092e1dd00 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -295,10 +295,15 @@ class ProjectsController < ApplicationController
redirect_to :controller => 'issues', :action => 'index', :project_id => @project and return unless @issues
@projects = []
# find projects to which the user is allowed to move the issue
- User.current.memberships.each {|m| @projects << m.project if m.role.allowed_to?(:controller => 'projects', :action => 'move_issues')}
+ if User.current.admin?
+ # admin is allowed to move issues to any active (visible) project
+ @projects = Project.find(:all, :conditions => Project.visible_by(User.current), :order => 'name')
+ else
+ User.current.memberships.each {|m| @projects << m.project if m.role.allowed_to?(:controller => 'projects', :action => 'move_issues')}
+ end
# issue can be moved to any tracker
@trackers = Tracker.find(:all)
- if request.post? and params[:new_project_id] and params[:new_tracker_id]
+ if request.post? && params[:new_project_id] && @projects.collect(&:id).include?(params[:new_project_id].to_i) && params[:new_tracker_id]
new_project = Project.find_by_id(params[:new_project_id])
new_tracker = Tracker.find_by_id(params[:new_tracker_id])
@issues.each do |i|