Skip to main content
1-Visitor
January 16, 2017
Question

How to add ACL using API

  • January 16, 2017
  • 1 reply
  • 2579 views

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

1 reply

17-Peridot
January 17, 2017

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

msingha1-VisitorAuthor
1-Visitor
January 19, 2017

Thanks a lot Bjorn. This really helped !!

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

17-Peridot
January 19, 2017

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