]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - security/runtime/org.argeo.security.core/src/main/java/org/argeo/security/jcr/OsJcrAuthenticationProvider.java
Update license headers
[lgpl/argeo-commons.git] / security / runtime / org.argeo.security.core / src / main / java / org / argeo / security / jcr / OsJcrAuthenticationProvider.java
index 5307673ced6eb589e4e49ea822f5a05d57e29f74..4f3e6a18e5a5ff0e3c4bf058c3664d915b79cbc2 100644 (file)
@@ -1,3 +1,18 @@
+/*
+ * Copyright (C) 2007-2012 Mathieu Baudier
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.argeo.security.jcr;
 
 import javax.jcr.Node;
@@ -13,7 +28,7 @@ import org.argeo.security.core.OsAuthenticationProvider;
 import org.springframework.security.Authentication;
 import org.springframework.security.AuthenticationException;
 
-/** Relies on OS to authenticate and additionaly setup JCR */
+/** Relies on OS to authenticate and additionally setup JCR */
 public class OsJcrAuthenticationProvider extends OsAuthenticationProvider {
        private Repository repository;
        private String securityWorkspace = "security";
@@ -50,10 +65,11 @@ public class OsJcrAuthenticationProvider extends OsAuthenticationProvider {
                        // the node
                        Node userNodeHome = JcrUtils.createUserHomeIfNeeded(nodeSession,
                                        username);
-                       JcrUtils.addPrivilege(nodeSession, userNodeHome.getPath(),
-                                       username, Privilege.JCR_ALL);
-                       if (nodeSession.hasPendingChanges())
-                               nodeSession.save();
+                       // FIXME how to set user home privileges *before* it is created ?
+                       // JcrUtils.addPrivilege(nodeSession, userNodeHome.getPath(),
+                       // username, Privilege.JCR_ALL);
+                       // if (nodeSession.hasPendingChanges())
+                       // nodeSession.save();
 
                        // user details
                        JcrUserDetails userDetails = new JcrUserDetails(userProfile, authen