From: Mathieu Baudier Date: Wed, 13 Mar 2013 15:15:42 +0000 (+0000) Subject: Check if user is anonymous X-Git-Tag: argeo-slc-2.1.7~416 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;ds=sidebyside;h=a9ca70ccd08c7505b1c2b5a0238fcd1dd930e752;hp=d79f9ae2d1a5f459e7ba5c1dc0264e2957c70a93;p=gpl%2Fargeo-slc.git Check if user is anonymous git-svn-id: https://svn.argeo.org/slc/trunk@6124 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- diff --git a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/views/DistributionsView.java b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/views/DistributionsView.java index cbed6adac..ed1848fc3 100644 --- a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/views/DistributionsView.java +++ b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/views/DistributionsView.java @@ -151,10 +151,13 @@ public class DistributionsView extends ViewPart implements SlcNames, ArgeoNames try { nodeSession = nodeRepository.login(); + Node homeNode = UserJcrUtils.getUserHome(nodeSession); + if (homeNode == null) // anonymous + throw new SlcException("User must be authenticated."); + // make sure base directory is available - Node repos = JcrUtils.mkdirs(nodeSession, - UserJcrUtils.getUserHome(nodeSession).getPath() - + RepoConstants.REPOSITORIES_BASE_PATH); + Node repos = JcrUtils.mkdirs(nodeSession, homeNode.getPath() + + RepoConstants.REPOSITORIES_BASE_PATH); nodeSession.save(); // register default local java repository @@ -410,8 +413,8 @@ public class DistributionsView extends ViewPart implements SlcNames, ArgeoNames return null; } - } - + } + /** Content provider */ private class DistributionsContentProvider implements ITreeContentProvider { Session nodeSession;