cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

How to add ACL using API

msingha
3-Newcomer

How to add ACL using API

Hello,

I have a requirement of providing modify access on an IBA of CustomConfigurableMastersLink (subtype of ConfigurableMastersLink).

I tried using AccessControlHelper API but got stuck in the parameters which it takes for creating new ACL.

AccessControlHelper.manager.createAccessControlRule(AdminDomainRef arg0, String arg1, State arg2, WTPrincipalReference arg3, AccessPermissionSet arg4, AccessPermissionSet arg5) throws WTException

Can someone please guide me with the parameters. Or with some alternate solution to give ACL using API.

Appreciate your help. 

Thank You.

Regards,

Manisha

3 REPLIES 3

It's not that easy! I needed a long time to figure it out, but I will provide it what I found out.

arg1 = AdminDomainRef adminDomainRef

AdministrativeDomain localAdministrativeDomain = AdministrativeDomainHelper.manager.getDomain(sDomain, localWTContainerRef);

adminDomainRef = (AdminDomainRef) (new ReferenceFactory()).getReference(localAdministrativeDomain);

arg2 = String objectType

arg3 = State lcState

arg4 = WTPrincipalReference wtPrincipalReference

arg5 = boolean false (Set default to false)

arg6 = AccessPermissionSet accessPermissionSetGrant

accessPermissionSetGrant.add(AccessPermission.ALL);

arg7 = AccessPermissionSet accessPermissionSetDeny

accessPermissionSetDeny.add(AccessPermission.ALL);

arg8 = AccessPermissionSet accessPermissionSetAbsolutDeny

accessPermissionSetAbsolutDeny.add(AccessPermission.ALL);

Call

AccessControlHelper.manager.createAccessControlRule(adminDomainRef, objectType, lcState, wtPrincipalReference, false, accessPermissionSetGrant, accessPermissionSetDeny, accessPermissionSetAbsolutDeny);

Hope that will help you

Thanks a lot Bjorn. This really helped !!

Just have one question, what does "sDomain" stands for in getDomain parameter..??

‌sDomain is the domain on the policy manager. This is most of the time /default or could be /default/pdm

Announcements

Top Tags