Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/validators/organizations/path_validator.rb')
-rw-r--r--app/validators/organizations/path_validator.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/validators/organizations/path_validator.rb b/app/validators/organizations/path_validator.rb
new file mode 100644
index 00000000000..a1c22654a32
--- /dev/null
+++ b/app/validators/organizations/path_validator.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+module Organizations
+ class PathValidator < ::NamespacePathValidator
+ def self.path_regex
+ Gitlab::PathRegex.organization_path_regex
+ end
+
+ def build_full_path_to_validate_against_reserved_names?
+ # full paths cannot be built for organizations because organizations do not have a parent
+ # and it does not include the `Routable` concern.
+ false
+ end
+ end
+end