GitLab ist jetzt auf dem neuesten Stand! Die jüngsten Probleme wurden behoben. Wir entschuldigen uns für die dadurch verursachten Unannehmlichkeiten.

Commit 881f686e authored by Daniel Gerhardt's avatar Daniel Gerhardt

Prevent group names of length < 5 when updating settings

This restriction does not apply to admins.
parent c9fe150c
......@@ -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
......@@ -223,10 +224,15 @@ class GroupsController < Groups::ApplicationController
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment