GitLab steht aufgrund wichtiger Wartungsarbeiten am Montag, den 8. März, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

Commit 4fa17a0f authored by Daniel Gerhardt's avatar Daniel Gerhardt

Forbid creation of groups with a path length < 5

This restriction does not apply to admins.
parent 46630244
......@@ -18,6 +18,8 @@ class GroupsController < Groups::ApplicationController
before_action :user_actions, only: [:show, :subgroups]
before_filter :validate_name, only: :create
layout :determine_layout
def index
......@@ -176,6 +178,14 @@ def user_actions
def validate_name
@group =
unless @group.path.empty? || @group.path.length > 4 || current_user.admin?[:alert] = 'Path must have at least a length of 5.'
render action: "new"
def build_canonical_path(group)
return group_path(group) if action_name == 'show' # root group path
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