Project path validation: array of not allowed paths
This commit is contained in:
parent
37e39e4176
commit
8272e18e57
1 changed files with 4 additions and 2 deletions
|
@ -104,8 +104,10 @@ class Project < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def repo_name
|
def repo_name
|
||||||
if path == "gitolite-admin"
|
denied_paths = %w(gitolite-admin groups projects dashboard)
|
||||||
errors.add(:path, " like 'gitolite-admin' is not allowed")
|
|
||||||
|
if denied_paths.include?(path)
|
||||||
|
errors.add(:path, "like #{path} is not allowed")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue