AnsweredAssumed Answered

Authentication error on my own element?

Question asked by SvenBatalla on Sep 16, 2015
Latest reply on Sep 16, 2015 by SvenBatalla

I have an application that creates elements based on a template.  In some cases, after the element is created, an analysis expression needs to be modified that can't be done at the template level.  For example, my element template has a simple analysis template baked in that simply has a "No Operation" sort of result.  However, in some cases, the user decides that a specific element really does need an expression to be evaluated and thus provides an expression.  That expression is then applied to the analysis for that specific element.  Take a look at the following link if you're interested in a previous discussion on how that is achieved:

 

Can the AF Analysis engine evaluate strings?

 

The actual problem arises when I am creating an element.  I have granted the user permissions to read/write elements.  I have granted the user permissions to read/write in the database.  I have granted the user permissions to read/write analyses.  However, despite that, when I attempt to create an element and then modify the analysis within that element, I get the following error:

 

System.Security.SecurityException: Cannot complete the operation because the user does not have rights to delete Analysis 'Is OON (EF)' with UniqueID '7230e7b6-5c71-11e5-9e90-005056a56372'.
   at OSIsoft.AF.PISystem.CheckServerError(dcServerError err, Boolean firstAttempt)
   at OSIsoft.AF.Support.AFSerialProxy.<>c__DisplayClass3e.<CheckInAnalysis>b__3d(Boolean firstAttempt)
   at OSIsoft.AF.Support.AFSerialProxy.Call(String rpcName, ProxyDelegate codeBlock)
   at OSIsoft.AF.Support.AFSerialProxy.CheckInAnalysis(dcAnalysis[] changes, dcObjectIdentity[] deletedIdentities)
   at OSIsoft.AF.Analysis.AFAnalysis.RemoteCheckInAnalysis(AFDatabase database, dcAnalysis[] changes, dcObjectIdentity[] deletedIdentities)
   at OSIsoft.AF.AFDatabase.SaveAnalyses(Boolean doCheckIn, Boolean mustApplyChangesForListCheckIn, Boolean disableObjectListCheckIn, Int32 maxChangedItems, List`1 appliedList, List`1 changeList, List`1 deleteList)
   at OSIsoft.AF.AFDatabase.ProcessDatabaseApplyCheckInChanges(ProcessMode mode, AFCheckedOutMode checkedOutMode, IEnumerable`1 objList, List`1 appliedList, HashSet`1 elementsWithAutoCreatedAnalyses, Boolean& dbPagedRefreshRequired)
   at OSIsoft.AF.AFDatabase.ProcessDatabaseChanges(ProcessMode mode, AFCheckedOutMode checkedOutMode, IEnumerable`1 objList, List`1 appliedList, HashSet`1 elementsWithAutoCreatedAnalyses)
   at OSIsoft.AF.AFDatabase.ProcessDatabaseChanges(ProcessMode mode, AFCheckedOutMode checkedOutMode)
   at OSIsoft.AF.AFDatabase.CheckIn(AFCheckedOutMode mode)

 

Does anyone have any ideas how to get past this?  It's a blocking issue for me at the moment.

Outcomes