use of org.apache.jackrabbit.core.security.AccessManager in project jackrabbit by apache.
the class SimpleSecurityManager method getAccessManager.
/**
* @see JackrabbitSecurityManager#getAccessManager(Session,AMContext)
*/
public AccessManager getAccessManager(Session session, AMContext amContext) throws RepositoryException {
checkInitialized();
try {
String wspName = session.getWorkspace().getName();
AccessControlProvider acP = getAccessControlProvider(systemSession, wspName);
AccessManagerConfig amc = config.getAccessManagerConfig();
AccessManager accessMgr;
if (amc == null) {
accessMgr = new SimpleAccessManager();
} else {
accessMgr = amc.newInstance(AccessManager.class);
}
accessMgr.init(amContext, acP, workspaceAccessManager);
return accessMgr;
} catch (AccessDeniedException ade) {
// re-throw
throw ade;
} catch (Exception e) {
// wrap in RepositoryException
String msg = "failed to instantiate AccessManager implementation: " + SimpleAccessManager.class.getName();
log.error(msg, e);
throw new RepositoryException(msg, e);
}
}
Aggregations