summaryrefslogtreecommitdiff
path: root/logic/cartridge
diff options
context:
space:
mode:
authoricebaker <icebaker@proton.me>2023-11-18 20:08:34 -0300
committericebaker <icebaker@proton.me>2023-11-18 20:08:34 -0300
commit89962f27a75183947fc44cd051a1061ce157221d (patch)
tree1d39a227a58ffc24a73401f697592af229be1d0c /logic/cartridge
parent989c276b6acf9d0e2b584d980b72a4eb9564a77c (diff)
adding safety sandbox
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