Merge branch '16133-federation-loop'
[arvados.git] / services / api / app / models / arvados_model.rb
index 946c4262e3a0eeeb1297cf51f1fba9ab183a1d96..816dbf4758dd0baa6e4ca438434b0b770fd1c0b7 100644 (file)
@@ -738,6 +738,14 @@ class ArvadosModel < ApplicationRecord
     end
   end
 
+  def ensure_filesystem_compatible_name
+    if name == "." || name == ".."
+      errors.add(:name, "cannot be '.' or '..'")
+    elsif Rails.configuration.Collections.ForwardSlashNameSubstitution == "" && !name.nil? && name.index('/')
+      errors.add(:name, "cannot contain a '/' character")
+    end
+  end
+
   class Email
     def self.kind
       "email"