Well, I'm not aware of a single line of code to do for all nodes, and I did it by copying x time and use notepad++ or intellij idea to put 1 to 1500 at the and of them smartly within few seconds. Then ran all of them and... Thats it. All nodes permissions for all groups were reset.