Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
projects.thm.de
GitLab
Commits
a3ac479d
Commit
a3ac479d
authored
Apr 14, 2015
by
Daniel Gerhardt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Forbid paths matching the pattern of THM usernames
parent
e41cf9b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
0 deletions
+2
-0
app/models/group.rb
app/models/group.rb
+1
-0
app/models/project.rb
app/models/project.rb
+1
-0
No files found.
app/models/group.rb
View file @
a3ac479d
...
...
@@ -53,6 +53,7 @@ class Group < Namespace
validate
:visibility_level_allowed_by_sub_groups
validate
:visibility_level_allowed_by_parent
validates
:variables
,
variable_duplicates:
true
validates
:path
,
format:
{
without:
/\A([a-zA-Z]{4}[0-9]{2}|hg[0-9]+)\z/
,
message:
"must not match the format of THM usernames"
}
validates
:two_factor_grace_period
,
presence:
true
,
numericality:
{
greater_than_or_equal_to:
0
}
...
...
app/models/project.rb
View file @
a3ac479d
...
...
@@ -344,6 +344,7 @@ class Project < ActiveRecord::Base
inclusion:
{
in:
->
(
_object
)
{
Gitlab
.
config
.
repositories
.
storages
.
keys
}
}
validates
:variables
,
variable_duplicates:
{
scope: :environment_scope
}
validates
:bfg_object_map
,
file_size:
{
maximum: :max_attachment_size
}
validates
:path
,
format:
{
without:
/\A([a-zA-Z]{4}[0-9]{2}|hg[0-9]+)\z/
,
message:
"must not match the format of THM usernames"
}
# Scopes
scope
:pending_delete
,
->
{
where
(
pending_delete:
true
)
}
...
...
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