Community discussions

MikroTik App
 
vic666
just joined
Topic Author
Posts: 23
Joined: Mon Dec 14, 2015 8:25 pm

Policy "policy" required for access to global variables

Sat Nov 02, 2019 6:59 pm

It looks like there could be a bug in RouterOS or the documentation is faulty.

According to the Manual:Scripting, the policy "policy" is necessary if the script needs access to user policies.

This information doesn't seem complete. As is explained in Manual: Router_AAA, the policy "policy" also needs to be set if a script requires access to global variables set by other users.

As far as I can see in my own tests, the policy "policy" is actually required to access any kind of global variables, not just those by other users. Specifically, following the Wiki page on how to set up DDNS for No-IP.com and giving the first script on the page the policy "read,write,test", as described in the article, I noticed that the script would update the IP anytime it was run, even if there was no change. Using :log info, I checked and could confirm that the global variable was always empty when retrieved after re-running the script. Changing the Policy to "read,write,test,policy" solved the issue.

Can you confirm the bug/error in documentation or is something not correct on my end?
 
User avatar
Deantwo
Member
Member
Posts: 331
Joined: Tue Sep 30, 2014 4:07 pm

Re: Policy "policy" required for access to global variables

Thu Dec 01, 2022 11:26 am

Accessing global variables require "read,write,policy" policies, if I remember correctly.
A bit more discussion here: viewtopic.php?t=145437

Who is online

Users browsing this forum: Ahrefs [Bot], coreshock, GoogleOther [Bot], johnson73 and 77 guests