Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GitLab
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
projects.thm.de
GitLab
Commits
62ac42b7
Commit
62ac42b7
authored
Apr 28, 2015
by
Daniel Gerhardt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Forbid creation of groups with a path length < 5
This restriction does not apply to admins.
parent
707be803
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
app/controllers/groups_controller.rb
app/controllers/groups_controller.rb
+10
-0
No files found.
app/controllers/groups_controller.rb
View file @
62ac42b7
...
...
@@ -24,6 +24,8 @@ class GroupsController < Groups::ApplicationController
before_action
:user_actions
,
only:
[
:show
]
before_filter
:validate_name
,
only: :create
skip_cross_project_access_check
:index
,
:new
,
:create
,
:edit
,
:update
,
:destroy
,
:projects
# When loading show as an atom feed, we render events that could leak cross
...
...
@@ -193,6 +195,14 @@ def user_actions
end
end
def
validate_name
@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"
end
end
def
build_canonical_path
(
group
)
return
group_path
(
group
)
if
action_name
==
'show'
# root group path
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment