public Authorizable getAuthorizable(Principal principal) throws RepositoryException {
Session session = getSession();
Authorizable authorizable = null;
if (principal instanceof ItemBasedPrincipal) {
String authPath = ((ItemBasedPrincipal) principal).getPath();
if (session.nodeExists(authPath)) {
Node n = session.getNode(authPath);
authorizable = getAuthorizable(n);
}
} else {
// another Principal implementation.