Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Release Tools Bot <robert+release-tools@gitlab.com>2019-03-26 19:06:01 +0300
committerGitLab Release Tools Bot <robert+release-tools@gitlab.com>2019-03-26 19:06:01 +0300
commit13cdbd64475772c66821470b0190b17c17be1958 (patch)
tree936c3af7f6070261d325a50995fb225b7bed1609 /app
parent875e1063c848e980d0317e36d3af86e494ed92fb (diff)
parentd7fac03fc97c5c5b243f5cd0fe592b30050402c3 (diff)
Merge branch 'security-mass-assignment-on-project-update-11-8' into '11-8-stable'
Disallow changing namespace of a project in update method See merge request gitlab/gitlabhq!3032
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects_controller.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 33c6608d321..f76e6663995 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -47,7 +47,7 @@ class ProjectsController < Projects::ApplicationController
end
def create
- @project = ::Projects::CreateService.new(current_user, project_params).execute
+ @project = ::Projects::CreateService.new(current_user, project_params(attributes: project_params_create_attributes)).execute
if @project.saved?
cookies[:issue_board_welcome_hidden] = { path: project_path(@project), value: nil, expires: Time.at(0) }
@@ -328,9 +328,9 @@ class ProjectsController < Projects::ApplicationController
end
# rubocop: enable CodeReuse/ActiveRecord
- def project_params
+ def project_params(attributes: [])
params.require(:project)
- .permit(project_params_attributes)
+ .permit(project_params_attributes + attributes)
end
def project_params_attributes
@@ -349,11 +349,10 @@ class ProjectsController < Projects::ApplicationController
:last_activity_at,
:lfs_enabled,
:name,
- :namespace_id,
:only_allow_merge_if_all_discussions_are_resolved,
:only_allow_merge_if_pipeline_succeeds,
- :printing_merge_request_link_enabled,
:path,
+ :printing_merge_request_link_enabled,
:public_builds,
:request_access_enabled,
:runners_token,
@@ -375,6 +374,10 @@ class ProjectsController < Projects::ApplicationController
]
end
+ def project_params_create_attributes
+ [:namespace_id]
+ end
+
def custom_import_params
{}
end