Mark-sai Respected Contributor.
Respected Contributor.
415 views

Manage ACL using .Net SDK

Hi,

I am converting some COMSDK code into .Net SDK and wondering what is the equavalent of managing ACL in .Net. I could not find any example in the documentation.

 

Thanks,

0 Likes
2 Replies
Micro Focus Expert
Micro Focus Expert

Re: Manage ACL using .Net SDK

Sorry, don't have time for a full sample today.

Start with Record.AccessControlList.

Depending on the version of RM you are using do not do this:  myRecord.AccessControlList.SetAccessLocations(...)

Do this instead:

 

TrimAccessControlList tacl = rec.AccessControlList;
tacl.SetAccessLocations(...)
rec.AccessControlList =tacl;

Of course you have methods like SetAllPrivate() and SetAllPublic().  

 

Use TrimAccessControlList.FunctionEnum to work out which enum to use for the forfunction parameter in SetAccessLocations.

 


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**
Highlighted
Matt Bayliss Super Contributor.
Super Contributor.

Re: Manage ACL using .Net SDK

In addition to David's answer, just wanted to mention the enums of most use are:

  • HP.HPTRIM.SDK.RecordAccess
  • HP.HPTRIM.SDK.GeneralAccess

And you have to cast them as int to use them:

TrimAccessControlList acl = record.AccessControlList;
acl.SetPrivate((int)RecordAccess.UpdateDocument, trimdb.CurrentUser);
record.AccessControlList = acl;

Other references:

 

Cheers,

Matt

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.