diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index 2fd48b02f3643c8fdcdeaa177546c3ce955920dd..85aaf1858e54d1efa9370515cf71d45eca88341d 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -24,7 +24,8 @@ class GroupsController < Groups::ApplicationController before_action :user_actions, only: [:show] - before_filter :validate_name, only: :create + before_filter :validate_name, only: [:create, :update] + skip_cross_project_access_check :index, :new, :create, :edit, :update, :destroy, :projects @@ -196,10 +197,15 @@ def user_actions end def validate_name - @group = Group.new(group_params) - unless @group.path.empty? || @group.path.length > 4 || current_user.admin? + group = Group.new(group_params) + unless group.path.empty? || group.path.length > 4 || current_user.admin? flash.now[:alert] = 'Path must have at least a length of 5.' - render action: "new" + if action_name == 'update' + render action: 'edit' + else + @group = group + render action: 'new' + end end end