i have times when using API (and even regular CLI) that variables are not really global. For instance, user ‘admin’ logs in, declares a variable using :global. Then a script cannot access that same variable because it’s running as a different user (*sys?). Even declaring it to import it doesnt bring it in. Is it also possible API user isnt able to read global variables set by other users? Seems like sometimes they are isolated, and if you reboot and allow only one user (the system user, or admin) then it all works fine. Are global variables truly GLOBAL (api, scheduler jobs that runs scripts, and admin user interactively) ?
can you control which user a script is run under? for example, scheduler has a job that runs on startup and it declares some global variables. How can a user login with CLI and/or API and still be able to modify those globals? and what is *sys?
just a note - you have to run this as user with policy permissions set. If we look at default groups, that means that users of group full can cross access other user variables. but even then, not in a direct way.
for example, setting up as admin
:global test1 aaa
and as user “tester”
:global test1 bbb
will result in
> sy script environment print
# USER NAME VALUE
0 admin test1 aaa
1 tester test1 bbb
Aaaah, this is helping me understand! I didn’t even know /system script environment existed, I have only known about ‘:environment print’ for a long time. . . This info should be added to the scripting wiki or manual : ) Thanks!