Removing Security Privileges

For posterity, as the XML snippet above alludes, component permissions are stored via Swing's putClientProperty method.

So you could combine a script like this:

With calling the static method on ComponentPermissions:

To get something like this:

from com.inductiveautomation.vision.api.client.components.model.security import ComponentPermissions

def getComponents(window):
	def walkComponents(component):
		for component in component.components:
			yield component
			walkComponents(component)
	
	return walkComponents(window.rootContainer)

for path in system.gui.getOpenWindowNames():
	win = system.gui.getWindow(path)
	for component in getComponents(win):
		ComponentPermissions.set(component, None)

You could open a batch of windows in the designer, then execute that script in the script console, then save those windows and open the next batch, to very quickly remove all configured component security in Vision.

1 Like