Sandbox a custom module by not letting it access requiring script globals

  1. What do you want to achieve?
    I have a script that requires user-generated modules, and I want the user-generated modules to not be able to access the constants in my script, that requires them, and also to not be able to use setfenv or getfenv.

  2. What solutions have you tried so far?
    I’ve taken a look at a few topics on the devforum but so far I didn’t find anything that fits what I want to do,
    the current solutions here say how to create a custom enviroment with limited globals, but instead I want to create a custom enviroment where I can blacklist globals, instead of whitelisting them, and I also don’t want to let the modules I require access constants inside the script that requires them.

Sorry for asking so much, but has anyone solved this in the past or is willing to, and if so, do you have a solution I could try?

1 Like