X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=server%2Fruntime%2Forg.argeo.server.jcr%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fjcr%2Fsecurity%2FSecurityJcrUtils.java;h=90a8d87bdd124d08d2e9fa1e89fd7734dfde07f3;hb=d6689b6266b735baa0f9a2a0dcf14422a6a46377;hp=abf4347db4bc930ab24e2c53853415471d5b3c4c;hpb=2c4852dcd20d4cde88776c527ae935f242ae1e77;p=lgpl%2Fargeo-commons.git diff --git a/server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/security/SecurityJcrUtils.java b/server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/security/SecurityJcrUtils.java index abf4347db..90a8d87bd 100644 --- a/server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/security/SecurityJcrUtils.java +++ b/server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/security/SecurityJcrUtils.java @@ -7,18 +7,19 @@ import javax.jcr.version.VersionManager; import org.argeo.ArgeoException; import org.argeo.jcr.ArgeoJcrConstants; -import org.argeo.jcr.ArgeoJcrUtils; import org.argeo.jcr.ArgeoNames; import org.argeo.jcr.ArgeoTypes; import org.argeo.jcr.JcrUtils; +import org.argeo.jcr.UserJcrUtils; /** Utilities related to Argeo security model in JCR */ +@Deprecated public class SecurityJcrUtils implements ArgeoJcrConstants { /** * Creates an Argeo user home, does nothing if it already exists. Session is * NOT saved. */ - public static Node createUserHomeIfNeeded(Session session, String username) { + static Node createUserHomeIfNeeded(Session session, String username) { try { String homePath = generateUserHomePath(username); if (session.itemExists(homePath)) @@ -27,8 +28,9 @@ public class SecurityJcrUtils implements ArgeoJcrConstants { Node userHome = JcrUtils.mkdirs(session, homePath); userHome.addMixin(ArgeoTypes.ARGEO_USER_HOME); userHome.setProperty(ArgeoNames.ARGEO_USER_ID, username); - - //JcrUtils.addPrivilege(session, homePath, username, "jcr:all"); + + // JcrUtils.addPrivilege(session, homePath, username, + // "jcr:all"); return userHome; } } catch (RepositoryException e) { @@ -39,7 +41,7 @@ public class SecurityJcrUtils implements ArgeoJcrConstants { } private static String generateUserHomePath(String username) { - String homeBasePath = DEFAULT_HOME_BASE_PATH; + String homeBasePath = UserJcrUtils.DEFAULT_HOME_BASE_PATH; return homeBasePath + '/' + JcrUtils.firstCharsToPath(username, 2) + '/' + username; } @@ -50,7 +52,7 @@ public class SecurityJcrUtils implements ArgeoJcrConstants { * is not saved and the node is in a checkedOut state (that is, it requires * a subsequent checkin after saving the session). */ - public static Node createUserProfile(Session session, String username) { + static Node createUserProfile(Session session, String username) { try { Node userHome = createUserHomeIfNeeded(session, username); if (userHome.hasNode(ArgeoNames.ARGEO_PROFILE)) @@ -78,7 +80,7 @@ public class SecurityJcrUtils implements ArgeoJcrConstants { * * @return the user profile */ - public static Node createUserProfileIfNeeded(Session securitySession, + static Node createUserProfileIfNeeded(Session securitySession, String username) { try { Node userHome = createUserHomeIfNeeded(securitySession, username); @@ -103,9 +105,9 @@ public class SecurityJcrUtils implements ArgeoJcrConstants { /** * @return null if not found * */ - public static Node getUserProfile(Session session, String username) { + static Node getUserProfile(Session session, String username) { try { - Node userHome = ArgeoJcrUtils.getUserHome(session, username); + Node userHome = UserJcrUtils.getUserHome(session, username); if (userHome == null) return null; if (userHome.hasNode(ArgeoNames.ARGEO_PROFILE))