Improve RCP security
[lgpl/argeo-commons.git] / security / runtime / org.argeo.security.jackrabbit / src / main / java / org / argeo / security / jackrabbit / ArgeoSecurityManager.java
index 1838dd05ef14741cc768eeea81a9d8062b52cf8b..bf33b8a2808369f5e0795f465aaba9620a0d3d66 100644 (file)
@@ -32,6 +32,8 @@ import org.springframework.security.GrantedAuthority;
 
 /** Intermediary class in order to have a consistent naming in config files. */
 public class ArgeoSecurityManager extends DefaultSecurityManager {
+       public final static String HOME_BASE_PATH = "/home";
+
        private Log log = LogFactory.getLog(ArgeoSecurityManager.class);
 
        @Override
@@ -61,7 +63,7 @@ public class ArgeoSecurityManager extends DefaultSecurityManager {
                                        .toString(), authen, null);
                        log.info(userId + " added as " + user);
                }
-               
+
                setHomeNodeAuthorizations(user);
 
                // process groups
@@ -99,6 +101,11 @@ public class ArgeoSecurityManager extends DefaultSecurityManager {
                try {
                        userId = user.getID();
                        Node userHome = JcrUtils.getUserHome(getSystemSession(), userId);
+                       // autocreate home node?
+//                     if (userHome == null)
+//                             userHome = JcrUtils.createUserHome(getSystemSession(),
+//                                             HOME_BASE_PATH, userId);
+
                        if (userHome != null) {
                                String path = userHome.getPath();
                                AccessControlPolicy policy = null;