@@ -368,7 +368,7 class Project < ActiveRecord::Base | |||||
368 | # by the current user |
|
368 | # by the current user | |
369 | def allowed_parents |
|
369 | def allowed_parents | |
370 | return @allowed_parents if @allowed_parents |
|
370 | return @allowed_parents if @allowed_parents | |
371 |
@allowed_parents = Project. |
|
371 | @allowed_parents = Project.allowed_to(User.current, :add_subprojects).to_a | |
372 | @allowed_parents = @allowed_parents - self_and_descendants |
|
372 | @allowed_parents = @allowed_parents - self_and_descendants | |
373 | if User.current.allowed_to?(:add_project, nil, :global => true) || (!new_record? && parent.nil?) |
|
373 | if User.current.allowed_to?(:add_project, nil, :global => true) || (!new_record? && parent.nil?) | |
374 | @allowed_parents << nil |
|
374 | @allowed_parents << nil |
General Comments 0
You need to be logged in to leave comments.
Login now