Change profile and user home
[lgpl/argeo-commons.git] / security / runtime / org.argeo.security.jackrabbit / src / main / java / org / argeo / security / jackrabbit / ArgeoSecurityManager.java
index 4af5d3f3d5a53997b79418e7a019d7c0f8e8cc4c..efd19b87d6a7e22539208a32a3d81dacf03a5d0e 100644 (file)
@@ -40,7 +40,8 @@ import org.springframework.security.GrantedAuthority;
 
 /** Integrates Spring Security and Jackrabbit Security user and roles. */
 public class ArgeoSecurityManager extends DefaultSecurityManager {
-       private Log log = LogFactory.getLog(ArgeoSecurityManager.class);
+       private final static Log log = LogFactory
+                       .getLog(ArgeoSecurityManager.class);
 
        /**
         * Since this is called once when the session is created, we take the
@@ -71,7 +72,9 @@ public class ArgeoSecurityManager extends DefaultSecurityManager {
                        authen = authens.iterator().next();
 
                // sync Spring and Jackrabbit
-               syncSpringAndJackrabbitSecurity(authen);
+               // workspace is irrelevant here
+               UserManager systemUm = getSystemUserManager(null);
+               syncSpringAndJackrabbitSecurity(systemUm, authen);
 
                return authen.getName();
        }
@@ -80,13 +83,10 @@ public class ArgeoSecurityManager extends DefaultSecurityManager {
         * Make sure that the Jackrabbit security model contains this user and its
         * granted authorities
         */
-       protected void syncSpringAndJackrabbitSecurity(Authentication authen)
-                       throws RepositoryException {
+       static void syncSpringAndJackrabbitSecurity(UserManager systemUm,
+                       Authentication authen) throws RepositoryException {
                long begin = System.currentTimeMillis();
 
-               // workspace is irrelevant here
-               UserManager systemUm = getSystemUserManager(null);
-
                String userId = authen.getName();
                User user = (User) systemUm.getAuthorizable(userId);
                if (user == null) {