Updating ACL's (Code conversion)
I am trying to convert some COM code to the V8 .net API.
I have the following code that I cannot seem to find how to convert, there are no matching enums:
person.SetAccessControlDetails(TRIMSDK.gxGeneralAccess.gxDelete, TRIMSDK.asAccessControlSettings.asPrivate, masterUser)
I realise that I need to get the ACL list of the person location, set the ACL then assign the ACL list back to the person location, just having problems finding the conversion for gxGeneralAccess.gxDelete.
Re: Updating ACL's (Code conversion)
TrimAccessControlList acl = loc.AccessControlList; acl.SetCurrentAccessControlSettings((int)GeneralAccess.Delete, AccessControlSettings.Private); loc.AccessControlList = acl; loc.Save();
Of course you may also want to do this to give a different user Delete permission:
Location masterLoc = new Location(database, 9000000032); TrimAccessControlList acl = loc.AccessControlList; acl.SetPrivate((int)GeneralAccess.Delete, masterLoc); loc.AccessControlList = acl; loc.Save();
The key is that the TrimAccessControlList object has a property called FunctionEnum. This will tell you which Enum to use, in this case it is GeneralAccess, for a Record it will be RecordAccess.