How to test userid against ACL

Is it possible to test if the current user is in an ACL? I couldn’t find a service nor API for it but obviously wM must do it somehow.

I currently do it the very crude way: have a dummy service secured with the ACL in question and check if its invocation throws an error. There must be a better way.

Thanks

Manuel

Let me make sure that I understand you correctly - so you want to have a service such that it takes the name of an ACL (eg Developers, Internal, etc), checks the current user against that ACL and returns ‘true/false’ or ‘yes/no’.

Hmm I do not know whether this is recommeded to use a service from WmRoot package, but you can invoke wm.server.access:aclList (service is in WmRoot package) to get a document list of all the ACLs defined on your IS. Each doc in this docList is defined as in the attachment - now all you need to do is to loop over this document list, branch for the ACL name you gave as input and then check the aclgroup/allowed string list to see if it contains the current user.

Hope this helps. Rohit
ACLs.gif