MIPAC

Setting security via the AF SDK

Discussion created by MIPAC on Mar 6, 2013
Latest reply on Mar 6, 2013 by MIPAC

I'm looking to be able to set security on AF objects via the AF SDK. There is an excellent thread here on this topic, however I am finding that it doesn't quite address the issue I have come across. Using the SetSecurityString() method works well for objects such as an AFDatabase, or individual Elements, as they expose a Security property. What I would like to do however is set the security for a collection of objects. For example, I would first create a new AFDatabase, call the SetSecurityString() method of the AFDatabase.Security object, and then set the security for the various object collections owned by that database, before any objects are created within those collections. This can be done from PSE via the Security context menu on the database (Security -> Elements, Element Templates, Event Frames, etc).

 

My question is this: how do I do the same thing programatically (and without a UI)? The individual objects support setting security, but I can't see how to do this against the collections owned by the database. I can read the security settings using the AFDatabase.GetSecurity method, and specify an AFSecurityItem, but I can't find the way to write the security settings.

 

Appreciate any guidance or pointers to the best way to approach this.

 

Cheers,

 

John

Outcomes