public AccessControlManager getAccessControlManager() throws RepositoryException {
if (accessControlManager == null) {
AccessControlManager acm = getConfig(AuthorizationConfiguration.class)
.getAccessControlManager(delegate.getRoot(), namePathMapper);
if (acm instanceof JackrabbitAccessControlManager) {
accessControlManager = new JackrabbitAccessControlManagerDelegator(
delegate, (JackrabbitAccessControlManager) acm);
} else {
accessControlManager = new AccessControlManagerDelegator(delegate, acm);
}
}