/** * @param session The session used to create the principal manager. * @return A new instance of PrincipalManagerImpl * @throws javax.jcr.RepositoryException If an error occurs. */ protected PrincipalManager createPrincipalManager(SessionImpl session) throws RepositoryException { return new PrincipalManagerImpl(session, getPrincipalProviderRegistry().getProviders()); }
/** * @param session Session for the principal manager must be created. * @return A new instance of PrincipalManagerImpl. Note that this implementation * uses a workspace specific principal provider registry, that retrieves * the configured providers from the registry obtained through * {@link #getPrincipalProviderRegistry()} but has a workspace specific * default provider. * @throws RepositoryException */ @Override protected PrincipalManager createPrincipalManager(SessionImpl session) throws RepositoryException { return new PrincipalManagerImpl(session, getPrincipalProviderRegistry(session).getProviders()); }
/** * @param session The session used to create the principal manager. * @return A new instance of PrincipalManagerImpl * @throws javax.jcr.RepositoryException If an error occurs. */ protected PrincipalManager createPrincipalManager(SessionImpl session) throws RepositoryException { return new PrincipalManagerImpl(session, getPrincipalProviderRegistry().getProviders()); }
/** * @param session Session for the principal manager must be created. * @return A new instance of PrincipalManagerImpl. Note that this implementation * uses a workspace specific principal provider registry, that retrieves * the configured providers from the registry obtained through * {@link #getPrincipalProviderRegistry()} but has a workspace specific * default provider. * @throws RepositoryException */ @Override protected PrincipalManager createPrincipalManager(SessionImpl session) throws RepositoryException { return new PrincipalManagerImpl(session, getPrincipalProviderRegistry(session).getProviders()); }
/** * @see JackrabbitSecurityManager#getPrincipalManager(Session) */ public synchronized PrincipalManager getPrincipalManager(Session session) throws RepositoryException { checkInitialized(); if (session instanceof SessionImpl) { SessionImpl sImpl = ((SessionImpl)session); return new PrincipalManagerImpl(sImpl, principalProviderRegistry.getProviders()); } else { throw new RepositoryException("Internal error: SessionImpl expected."); } }
/** * @see JackrabbitSecurityManager#getPrincipalManager(Session) */ public synchronized PrincipalManager getPrincipalManager(Session session) throws RepositoryException { checkInitialized(); if (session instanceof SessionImpl) { SessionImpl sImpl = ((SessionImpl)session); return new PrincipalManagerImpl(sImpl, principalProviderRegistry.getProviders()); } else { throw new RepositoryException("Internal error: SessionImpl expected."); } }
/** * Test if a group which is not item based will be wrapped by a JackrabbitPrincipal implementation. * @throws NotExecutableException * @throws RepositoryException */ public void testJackrabbitPrincipal() throws NotExecutableException, RepositoryException { final PrincipalProvider testProvider = new CustomPrincipalProvider(); testProvider.init(new Properties()); PrincipalManagerImpl principalManager = new PrincipalManagerImpl(superuser, new PrincipalProvider[] { testProvider }); Principal principalFromManager = principalManager.getPrincipal(TESTGROUP_NAME); assertTrue(principalFromManager instanceof JackrabbitPrincipal); } }