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
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-08-26 15:10:28 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-26 15:10:28 +0300
commit6a0a4a80f740ccde8a1b4c6c757cb77286e0eec9 (patch)
tree673b9a5a8461b9be27efd02427fd9e4df2a39c6f /app/controllers/groups_controller.rb
parentc8a7e4ada117b968f841c2bb300fadc421cb3e98 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/groups_controller.rb')
-rw-r--r--app/controllers/groups_controller.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb
index 2796760fbe1..8a3c72ae4f8 100644
--- a/app/controllers/groups_controller.rb
+++ b/app/controllers/groups_controller.rb
@@ -64,6 +64,7 @@ class GroupsController < Groups::ApplicationController
def new
@group = Group.new(params.permit(:parent_id))
+ @group.build_namespace_settings
end
def create
@@ -269,7 +270,9 @@ class GroupsController < Groups::ApplicationController
:default_branch_name,
:allow_mfa_for_subgroups,
:resource_access_token_creation_allowed,
- :prevent_sharing_groups_outside_hierarchy
+ :prevent_sharing_groups_outside_hierarchy,
+ :setup_for_company,
+ :jobs_to_be_done
]
end
@@ -342,7 +345,15 @@ class GroupsController < Groups::ApplicationController
render action: 'new'
end
- def successful_creation_hooks; end
+ def successful_creation_hooks
+ update_user_role_and_setup_for_company
+ end
+
+ def update_user_role_and_setup_for_company
+ user_params = params.fetch(:user, {}).permit(:role)
+ user_params[:setup_for_company] = @group.setup_for_company if !@group.setup_for_company.nil? && current_user.setup_for_company.nil?
+ Users::UpdateService.new(current_user, user_params.merge(user: current_user)).execute if user_params.present?
+ end
def groups
if @group.supports_events?