diff --git a/app/models/project.rb b/app/models/project.rb index 1ba7bcff3..28cb52ddc 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -653,7 +653,7 @@ class Project < ActiveRecord::Base :if => lambda {|project, user| project.new_record? || user.allowed_to?(:select_project_modules, project) } safe_attributes 'inherit_members', - :if => lambda {|project, user| project.parent.nil? || project.parent.visible?(:user)} + :if => lambda {|project, user| project.parent.nil? || project.parent.visible?(user)} # Returns an array of projects that are in this project's hierarchy # diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb index 3927e41b0..be5c67e48 100644 --- a/test/functional/projects_controller_test.rb +++ b/test/functional/projects_controller_test.rb @@ -392,6 +392,13 @@ class ProjectsControllerTest < ActionController::TestCase assert_template 'settings' end + def test_settings_of_subproject + @request.session[:user_id] = 2 + get :settings, :id => 'private-child' + assert_response :success + assert_template 'settings' + end + def test_settings_should_be_denied_for_member_on_closed_project Project.find(1).close @request.session[:user_id] = 2 # manager