Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Privacy
Imprint
Contact
Login methods
Sign in
Toggle navigation
Menu
Open sidebar
projects.thm.de
GitLab
Commits
7db49da7
Commit
7db49da7
authored
Apr 14, 2015
by
Daniel Gerhardt
Browse files
Forbid paths matching the pattern of THM usernames
parent
95c2e8f6
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/models/group.rb
View file @
7db49da7
...
@@ -53,6 +53,7 @@ class Group < Namespace
...
@@ -53,6 +53,7 @@ class Group < Namespace
validate
:visibility_level_allowed_by_sub_groups
validate
:visibility_level_allowed_by_sub_groups
validate
:visibility_level_allowed_by_parent
validate
:visibility_level_allowed_by_parent
validates
:variables
,
variable_duplicates:
true
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
}
validates
:two_factor_grace_period
,
presence:
true
,
numericality:
{
greater_than_or_equal_to:
0
}
...
...
app/models/project.rb
View file @
7db49da7
...
@@ -342,6 +342,7 @@ class Project < ActiveRecord::Base
...
@@ -342,6 +342,7 @@ class Project < ActiveRecord::Base
inclusion:
{
in:
->
(
_object
)
{
Gitlab
.
config
.
repositories
.
storages
.
keys
}
}
inclusion:
{
in:
->
(
_object
)
{
Gitlab
.
config
.
repositories
.
storages
.
keys
}
}
validates
:variables
,
variable_duplicates:
{
scope: :environment_scope
}
validates
:variables
,
variable_duplicates:
{
scope: :environment_scope
}
validates
:bfg_object_map
,
file_size:
{
maximum: :max_attachment_size
}
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
# Scopes
scope
:pending_delete
,
->
{
where
(
pending_delete:
true
)
}
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