Ignition Permission Roles via scripting

Hi guys,
I’m using Ignition 7.9.7 and I would like to know if there is a way to set tag’s roles in UDT instance via scripting?
I tried to use this code (based on Ignition sdk examples) but it doesn’t seem to have any affect:

permissionsMap = HashMap()
zoneRole =  TagPermissionsModel.ZoneRole();
permissionsMap.put(zoneRole, True);
print permissionsMap
permissions = BasicTagPermissions(permissionsMap)
path = "UDT_instance/tag"
prop = WellKnownTagProps.locate("PermissionModel")
print type(WellKnownTagProps.locate("PermissionModel"))
config = system.tag.browseConfiguration(path, False)[0]
config.set(prop, permissions)

Best regards.