Fixed: parent project field doesn't include blank value when a member with 'add subproject' permission edits a child project (#4790).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3405 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2010-02-10 20:38:23 +00:00
parent a8a49a26a1
commit d02ddefff4
2 changed files with 43 additions and 1 deletions
+1 -1
View File
@@ -249,7 +249,7 @@ class Project < ActiveRecord::Base
return @allowed_parents if @allowed_parents
@allowed_parents = Project.find(:all, :conditions => Project.allowed_to_condition(User.current, :add_subprojects))
@allowed_parents = @allowed_parents - self_and_descendants
if User.current.allowed_to?(:add_project, nil, :global => true)
if User.current.allowed_to?(:add_project, nil, :global => true) || (!new_record? && parent.nil?)
@allowed_parents << nil
end
unless parent.nil? || @allowed_parents.empty? || @allowed_parents.include?(parent)