Alright, I have done a little test, as follows:

In myLeoSettings.leo:
    @bool scripting-at-script-nodes = True

With test.leo
    Under @settings, include this:
        @bool scripting-at-script-nodes = True
        
    create node @script myscript containing this:
        import datetime
        for p in c.all_positions():
            if p.h == 'THIS_IS_A_TEST':
                p.b = datetime.datetime.now()
        g.es('@script has run')

    create an empty node with headline THIS_IS_A_TEST

    When the outline is loaded, the following appears in the log window:
        Security warning! Ignoring...
        @bool scripting-at-script-nodes = True
        This setting can be True only in
        leoSettings.leo or myLeoSettings.leo
        disabled @script: myscript
    
    Make this change:
        @bool scripting-at-script-nodes = False

    When the outline is loaded, the following appears in the log window:
        disabled @script: myscript

    Finally, make this change:
        @@bool scripting-at-script-nodes = False

    When the outline is loaded, the following appears in the log window:
        executing script myscript
        @script has run
    and the node THIS_IS_A_TEST has the current date/time.


This shows that the value of the outline-local *scripting-at-script-nodes* 
flag is tested when test.leo is loaded, and that its value affects the 
ability to run @script nodes. Thus, it would appear that there could be an 
outline-local version of the flag, so that the global flag in 
myLeoSettings.leo could be set to False for default behavior. There would 
still be a security risk for a specific Leo file, which would need 
addressing, but it perhaps simplifies the problem somewhat.

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to