Highlighted
IdleLoop Absent Member.
Absent Member.
301 views

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.

0 Likes
1 Reply
Micro Focus Expert
Micro Focus Expert

Re: Updating ACL's (Code conversion)

Try this:

 

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.

 


Blog | Samples | HPE CM 9.3 SDK Docs
**Any opinions expressed in this forum are my own personal opinion and should not be interpreted as an official statement on behalf of MicroFocus**
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.