summaryrefslogtreecommitdiff
path: root/logic/cartridge
diff options
context:
space:
mode:
Diffstat (limited to 'logic/cartridge')
-rw-r--r--logic/cartridge/safety.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/logic/cartridge/safety.rb b/logic/cartridge/safety.rb
new file mode 100644
index 0000000..84b39d7
--- /dev/null
+++ b/logic/cartridge/safety.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+require_relative 'fetch'
+
+module NanoBot
+ module Logic
+ module Cartridge
+ module Safety
+ def self.sandboxed?(cartridge)
+ sandboxed = Fetch.cascate(cartridge, [%i[safety functions sandboxed]])
+ return true if sandboxed.nil?
+
+ sandboxed
+ end
+ end
+ end
+ end
+end