We have written a Data Reference to evaluate several AF attributes and write a status back to another AF attribute. This DR is very similar to the examples for roll-up, string concatenation ... posted in vCampus.
The dilemma, is that when a ProcessBook user with read-only access to the data tries to retrieve information using an Element Relative display, they receive an error message telling them that they don't have write permissions.
Our current connection to AF is standard:
Public myPISystems As New PISystems() Public myPISystem As PISystem Public myAFDB As AFDatabase Public sSystem As String Public sDataBase As String sAFServer = "MyServer" sDatabase = "MyDatabase" ' Open the PI System myPISystem = myPISystems(sAFServer) ' Check PISystems object, create if required If (myPISystem Is Nothing) Then myPISystems = New PISystems() ' Check AFDatabase object, create if required If (myAFDB Is Nothing) Then myAFDB = myPISystems(sAFServer).Databases(sDataBase) If Not myAFDB.Name.ToLower.Equals(sDataBase.ToLower) Then myAFDB = myPISystems.DefaultPISystem.Databases(sDataBase) ' Final confirmation to see if AF is connected ret = (Not (myAFDB Is Nothing))
Is there a way to determine the credentials of the login? I would like to assume an administrators role when this DR connects rather than assuming the role of the ProcessBook user.
Any suggestions are welcome.