jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ulrich <For...@gombers.de>
Subject Re: How to get the effective ACL for a given node
Date Fri, 12 Jul 2013 06:19:02 GMT
Have now tried to implement the AccessControlManager - but fail right away.
        private static void checkPolicy(String nodename) throws
RepositoryException {
                AccessControlManager acm =  session.getAccessControlManager();
                AccessControlPolicy[] acps = acm.getEffectivePolicies(nodename);
                for (AccessControlPolicy acp : acps) {
                        AccessControlList acl = (AccessControlList)acp;
                        for (AccessControlEntry ace :
acl.getAccessControlEntries()) {
                            LOGGER.info("ACE: {}", ace.getPrincipal());
                        }
                }
        }

I built this code based on the sample described in
"http://wiki.apache.org/jackrabbit/AccessControl". But I don't get beyond the
line
          "AccessControlManager acm =  session.getAccessControlManager();"
it fails with:
Exception in thread "main" javax.jcr.UnsupportedRepositoryOperationException:
JCR-1104
        at
org.apache.jackrabbit.jcr2spi.SessionImpl.getAccessControlManager(SessionImpl.java:501)
        at
com.lsy.webcc.samples.acls.TestAccessControlManager.checkPolicy(TestAccessControlManager.java:109)
        at
com.lsy.webcc.samples.acls.TestAccessControlManager.<init>(TestAccessControlManager.java:102)
        at
com.lsy.webcc.samples.acls.TestAccessControlManager.main(TestAccessControlManager.java:162)

My program runs with jackrabbit-standalone-2.7.0.jar.

brgds,
Ulrich

Mime
View raw message