This error occurs only on the first load of the vision client. Following that, the error does not appear anymore, and seems to function as normal. This should be running in the vision client context, which according to the docs, is within scope. Is there something I need to be initializing first before calling this function from within the graphic?
The offending line is about mid-way down on the system.tag.readBlocking instruction.
def verifySecurityArea(self, event):
roles = self.parent.Roles.split(',')
username = self.parent.Username
hostname = self.parent.Hostname
clientSettings = {
"Roles": roles,
"User": username,
"Hostname": hostname,
}
display_security = self.parent.DisplaySecurity
display_security = system.dataset.toPyDataSet(display_security)
area_index = event.source.Index
q_value = system.tag.readBlocking("02_addons/SYS_02_nav/NavBarManager/data/Area"+str(area_index)+"_Buttons")
button_ds = q_value.getValue()
button_ds = system.dataset.toPyDataSet(button_ds)
event.source.Area_Security_Valid = False
for row in button_ds:
display_path = row["DisplayPath"]
for display_row in display_security:
if display_row["DisplayPath"] == display_path:
if self.canAccess(clientSettings, display_row):
event.source.Area_Security_Valid = True
break
if event.source.Area_Security_Valid == True:
break
securitySettings = {
"Roles": event.source.Roles,
"Roles_All?": event.source.Roles_All,
"Users": event.source.Users,
"Users_Exclude?": event.source.Users_Exclusive,
"Hostnames": event.source.Hostnames,
"Hostnames_Exclude?": event.source.Hostnames_Exclusive,
}
event.source.Nav_Security_Valid = self.canAccess(clientSettings, securitySettings)