Hi Cris,

Have you already considered the apis provided by the PrivilegesInfo class
from [1]?  I would think that one of the
PrivilegesInfo#getEffectiveAccessRights or
PrivilegesInfo#getEffectiveAccessRightsForPrincipal apis should get you
pretty close to your requirements.

1.
https://github.com/apache/sling-org-apache-sling-jcr-jackrabbit-accessmanager/blob/master/src/main/java/org/apache/sling/jcr/jackrabbit/accessmanager/PrivilegesInfo.java

Regards,
Eric

On Wed, Jul 8, 2020 at 11:59 AM Cris Rockwell <cmroc...@umich.edu> wrote:

> Hello
>
> I want to write Java code that will help evaluate system users access to
> repository paths as part of a test suite for the system setup.
> For example; given a user ID, a path and a privilege, the method returns
> true or false.
>
>                 boolean userHasAccess (String Path, String Privilege,
> String userID)
>
> It looks like JackrabbitAccessControlManager (
> https://jackrabbit.apache.org/oak/docs/security/accesscontrol/editing.html
> <
> https://jackrabbit.apache.org/oak/docs/security/accesscontrol/editing.html>)
> might offer this utility, but so far I’m not able to find it in a bundle
> provided by Sling 12
>
> Does anyone have a recommendation?
>
> Thanks
> Cris Rockwell
>

Reply via email to