jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1441129 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: security/user/ spi/security/user/util/
Date Thu, 31 Jan 2013 19:03:22 GMT
Author: angela
Date: Thu Jan 31 19:03:22 2013
New Revision: 1441129

URL: http://svn.apache.org/viewvc?rev=1441129&view=rev
Log:
OAK-50 : Implement User Management

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserContext.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserImporter.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserValidator.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserValidatorProvider.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/user/util/UserUtility.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserContext.java?rev=1441129&r1=1441128&r2=1441129&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserContext.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserContext.java
Thu Jan 31 19:03:22 2013
@@ -20,7 +20,7 @@ import org.apache.jackrabbit.oak.api.Pro
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.spi.security.Context;
 import org.apache.jackrabbit.oak.spi.security.user.UserConstants;
-import org.apache.jackrabbit.oak.util.NodeUtil;
+import org.apache.jackrabbit.oak.util.TreeUtil;
 
 /**
  * UserContext... TODO
@@ -39,8 +39,7 @@ final class UserContext implements Conte
     //------------------------------------------------------------< Context >---
     @Override
     public boolean definesProperty(Tree parent, PropertyState property) {
-        NodeUtil node = new NodeUtil(parent);
-        String ntName = node.getPrimaryNodeTypeName();
+        String ntName = TreeUtil.getPrimaryTypeName(parent);
         if (UserConstants.NT_REP_USER.equals(ntName)) {
             return UserConstants.USER_PROPERTY_NAMES.contains(property.getName());
         } else if (UserConstants.NT_REP_GROUP.equals(ntName)) {
@@ -53,8 +52,7 @@ final class UserContext implements Conte
 
     @Override
     public boolean definesTree(Tree tree) {
-        NodeUtil node = new NodeUtil(tree);
-        String ntName = node.getPrimaryNodeTypeName();
+        String ntName = TreeUtil.getPrimaryTypeName(tree);
         return UserConstants.NT_REP_GROUP.equals(ntName) || UserConstants.NT_REP_USER.equals(ntName)
|| UserConstants.NT_REP_MEMBERS.equals(ntName);
     }
 }
\ No newline at end of file

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserImpl.java?rev=1441129&r1=1441128&r2=1441129&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserImpl.java
Thu Jan 31 19:03:22 2013
@@ -29,7 +29,7 @@ import org.apache.jackrabbit.oak.spi.sec
 import org.apache.jackrabbit.oak.spi.security.user.UserConstants;
 import org.apache.jackrabbit.oak.spi.security.user.util.PasswordUtility;
 import org.apache.jackrabbit.oak.spi.security.user.util.UserUtility;
-import org.apache.jackrabbit.oak.util.NodeUtil;
+import org.apache.jackrabbit.oak.util.TreeUtil;
 
 import static org.apache.jackrabbit.oak.api.Type.STRING;
 
@@ -141,7 +141,6 @@ class UserImpl extends AuthorizableImpl 
     //------------------------------------------------------------< private >---
     @CheckForNull
     private String getPasswordHash() {
-        NodeUtil n = new NodeUtil(getTree());
-        return n.getString(UserConstants.REP_PASSWORD, null);
+        return TreeUtil.getString(getTree(), UserConstants.REP_PASSWORD);
     }
 }
\ No newline at end of file

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserImporter.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserImporter.java?rev=1441129&r1=1441128&r2=1441129&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserImporter.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserImporter.java
Thu Jan 31 19:03:22 2013
@@ -55,7 +55,7 @@ import org.apache.jackrabbit.oak.spi.xml
 import org.apache.jackrabbit.oak.spi.xml.ProtectedPropertyImporter;
 import org.apache.jackrabbit.oak.spi.xml.ReferenceChangeTracker;
 import org.apache.jackrabbit.oak.spi.xml.TextValue;
-import org.apache.jackrabbit.oak.util.NodeUtil;
+import org.apache.jackrabbit.oak.util.TreeUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -115,7 +115,7 @@ import static org.apache.jackrabbit.oak.
  * </li>
  * </ul>
  */
-public class UserImporter implements ProtectedPropertyImporter, ProtectedNodeImporter {
+public class UserImporter implements ProtectedPropertyImporter, ProtectedNodeImporter, UserConstants
{
 
     private static final Logger log = LoggerFactory.getLogger(UserImporter.class);
 
@@ -225,8 +225,8 @@ public class UserImporter implements Pro
         }
 
         String propName = propInfo.getName();
-        if (UserConstants.REP_PRINCIPAL_NAME.equals(propName)) {
-            if (!isValid(def, UserConstants.NT_REP_AUTHORIZABLE, false)) {
+        if (REP_PRINCIPAL_NAME.equals(propName)) {
+            if (!isValid(def, NT_REP_AUTHORIZABLE, false)) {
                 return false;
             }
 
@@ -247,8 +247,8 @@ public class UserImporter implements Pro
                 }
             }
             return true;
-        } else if (UserConstants.REP_PASSWORD.equals(propName)) {
-            if (a.isGroup() || !isValid(def, UserConstants.NT_REP_USER, false)) {
+        } else if (REP_PASSWORD.equals(propName)) {
+            if (a.isGroup() || !isValid(def, NT_REP_USER, false)) {
                 log.warn("Unexpected authorizable or definition for property rep:password");
                 return false;
             }
@@ -262,7 +262,7 @@ public class UserImporter implements Pro
             processed, otherwise postpone it.
             */
             if (parent.getStatus() == Tree.Status.NEW) {
-                if (parent.hasProperty(UserConstants.REP_PRINCIPAL_NAME)) {
+                if (parent.hasProperty(REP_PRINCIPAL_NAME)) {
                     userManager.onCreate((User) a, pw);
                 } else {
                     // principal name not yet available -> remember the pw
@@ -272,8 +272,8 @@ public class UserImporter implements Pro
             }
             return true;
 
-        } else if (UserConstants.REP_IMPERSONATORS.equals(propName)) {
-            if (a.isGroup() || !isValid(def, UserConstants.MIX_REP_IMPERSONATABLE, true))
{
+        } else if (REP_IMPERSONATORS.equals(propName)) {
+            if (a.isGroup() || !isValid(def, MIX_REP_IMPERSONATABLE, true)) {
                 log.warn("Unexpected authorizable or definition for property rep:impersonators");
                 return false;
             }
@@ -284,8 +284,8 @@ public class UserImporter implements Pro
             referenceTracker.processedReference(new Impersonators(a.getID(), tvs));
             return true;
 
-        } else if (UserConstants.REP_DISABLED.equals(propName)) {
-            if (a.isGroup() || !isValid(def, UserConstants.NT_REP_USER, false)) {
+        } else if (REP_DISABLED.equals(propName)) {
+            if (a.isGroup() || !isValid(def, NT_REP_USER, false)) {
                 log.warn("Unexpected authorizable or definition for property rep:disabled");
                 return false;
             }
@@ -293,8 +293,8 @@ public class UserImporter implements Pro
             ((User) a).disable(propInfo.getTextValue().getString());
             return true;
 
-        } else if (UserConstants.REP_MEMBERS.equals(propName)) {
-            if (!a.isGroup() || !isValid(def, UserConstants.NT_REP_GROUP, true)) {
+        } else if (REP_MEMBERS.equals(propName)) {
+            if (!a.isGroup() || !isValid(def, NT_REP_GROUP, true)) {
                 return false;
             }
             // since group-members are references to user/groups that potentially
@@ -333,14 +333,12 @@ public class UserImporter implements Pro
     // ---------------------------------------------< ProtectedNodeImporter >---
     @Override
     public boolean start(Tree protectedParent) throws RepositoryException {
-        String repMembers = namePathMapper.getJcrName(UserConstants.NT_REP_MEMBERS);
-        NodeUtil parentNode = new NodeUtil(protectedParent);
-        if (parentNode.hasPrimaryNodeTypeName(repMembers)) {
-            NodeUtil groupNode = parentNode;
-            while (!groupNode.isRoot() && groupNode.hasPrimaryNodeTypeName(repMembers))
{
-                groupNode = groupNode.getParent();
+        if (NT_REP_MEMBERS.equals(TreeUtil.getPrimaryTypeName(protectedParent))) {
+            Tree groupTree = protectedParent;
+            while (!groupTree.isRoot() && NT_REP_MEMBERS.equals(TreeUtil.getPrimaryTypeName(groupTree)))
{
+                groupTree = groupTree.getParent();
             }
-            Authorizable auth = userManager.getAuthorizable(groupNode.getTree());
+            Authorizable auth = userManager.getAuthorizable(groupTree);
             if (auth == null) {
                 log.debug("Cannot handle protected node " + protectedParent + ". It nor one
of its parents represent a valid Authorizable.");
                 return false;
@@ -357,7 +355,7 @@ public class UserImporter implements Pro
     public void startChildInfo(NodeInfo childInfo, List<PropInfo> propInfos) throws
RepositoryException {
         checkNotNull(currentMembership);
 
-        if (UserConstants.NT_REP_MEMBERS.equals(childInfo.getPrimaryTypeName())) {
+        if (NT_REP_MEMBERS.equals(childInfo.getPrimaryTypeName())) {
             for (PropInfo prop : propInfos) {
                 for (TextValue tv : prop.getTextValues()) {
                     String name = namePathMapper.getJcrName(prop.getName());
@@ -365,7 +363,7 @@ public class UserImporter implements Pro
                 }
             }
         } else {
-            log.warn("{} is not of type {}", childInfo.getString(), UserConstants.NT_REP_MEMBERS);
+            log.warn("{} is not of type {}", childInfo.getString(), NT_REP_MEMBERS);
         }
     }
 
@@ -402,19 +400,20 @@ public class UserImporter implements Pro
 
     private boolean isValid(PropertyDefinition definition, String oakNodeTypeName, boolean
multipleStatus) {
         return multipleStatus == definition.isMultiple() &&
-               definition.getDeclaringNodeType().isNodeType(namePathMapper.getJcrName(oakNodeTypeName));
+                definition.getDeclaringNodeType().isNodeType(namePathMapper.getJcrName(oakNodeTypeName));
     }
 
     /**
      * Handling the import behavior
      *
      * @param msg The message to log a warning in case of {@link ImportBehavior#IGNORE}
-     * or {@link ImportBehavior#BESTEFFORT}
-     * @throws javax.jcr.nodetype.ConstraintViolationException If the import
-     * behavior is {@link ImportBehavior#ABORT}.
+     *            or {@link ImportBehavior#BESTEFFORT}
+     * @throws javax.jcr.nodetype.ConstraintViolationException
+     *          If the import
+     *          behavior is {@link ImportBehavior#ABORT}.
      */
-    private void handleFailure(String msg) throws ConstraintViolationException{
-        switch(importBehavior){
+    private void handleFailure(String msg) throws ConstraintViolationException {
+        switch (importBehavior) {
             case ImportBehavior.IGNORE:
             case ImportBehavior.BESTEFFORT:
                 log.warn(msg);
@@ -428,6 +427,7 @@ public class UserImporter implements Pro
     }
 
     //------------------------------------------------------< inner classes >---
+
     /**
      * Inner class used to postpone import of group membership to the very end
      * of the import. This allows to import membership of user/groups that
@@ -596,13 +596,13 @@ public class UserImporter implements Pro
             if (!nonExisting.isEmpty()) {
                 Tree userTree = root.getTree(a.getPath());
                 // copy over all existing impersonators to the nonExisting list
-                PropertyState impersonators = userTree.getProperty(UserConstants.REP_PRINCIPAL_NAME);
+                PropertyState impersonators = userTree.getProperty(REP_PRINCIPAL_NAME);
                 for (String existing : impersonators.getValue(STRINGS)) {
                     nonExisting.add(existing);
                 }
                 // and write back the complete list including those principal
                 // names that are unknown to principal provider.
-                userTree.setProperty(UserConstants.REP_PRINCIPAL_NAME, nonExisting, Type.STRINGS);
+                userTree.setProperty(REP_PRINCIPAL_NAME, nonExisting, Type.STRINGS);
             }
         }
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserValidator.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserValidator.java?rev=1441129&r1=1441128&r2=1441129&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserValidator.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserValidator.java
Thu Jan 31 19:03:22 2013
@@ -23,6 +23,7 @@ import javax.jcr.nodetype.ConstraintViol
 import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.PropertyState;
+import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.spi.commit.DefaultValidator;
 import org.apache.jackrabbit.oak.spi.commit.Validator;
@@ -31,7 +32,7 @@ import org.apache.jackrabbit.oak.spi.sec
 import org.apache.jackrabbit.oak.spi.security.user.util.PasswordUtility;
 import org.apache.jackrabbit.oak.spi.security.user.util.UserUtility;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
-import org.apache.jackrabbit.oak.util.NodeUtil;
+import org.apache.jackrabbit.oak.util.TreeUtil;
 import org.apache.jackrabbit.util.Text;
 
 import static com.google.common.base.Preconditions.checkNotNull;
@@ -44,13 +45,13 @@ import static com.google.common.base.Pre
  */
 class UserValidator extends DefaultValidator implements UserConstants {
 
-    private final NodeUtil parentBefore;
-    private final NodeUtil parentAfter;
+    private final Tree parentBefore;
+    private final Tree parentAfter;
     private final UserValidatorProvider provider;
 
     private final AuthorizableType authorizableType;
 
-    UserValidator(NodeUtil parentBefore, NodeUtil parentAfter, UserValidatorProvider provider)
{
+    UserValidator(Tree parentBefore, Tree parentAfter, UserValidatorProvider provider) {
         this.parentBefore = parentBefore;
         this.parentAfter = parentAfter;
         this.provider = provider;
@@ -118,19 +119,19 @@ class UserValidator extends DefaultValid
 
     @Override
     public Validator childNodeAdded(String name, NodeState after) throws CommitFailedException
{
-        NodeUtil node = checkNotNull(parentAfter.getChild(name));
+        Tree tree = checkNotNull(parentAfter.getChild(name));
 
-        AuthorizableType type = UserUtility.getType(node);
+        AuthorizableType type = UserUtility.getType(tree);
         String authRoot = UserUtility.getAuthorizableRootPath(provider.getConfig(), type);
         if (authRoot != null) {
-            assertHierarchy(node, authRoot);
+            assertHierarchy(tree, authRoot);
             // assert rep:principalName is present (that should actually by covered
             // by node type validator)
-            if (node.getString(REP_PRINCIPAL_NAME, null) == null) {
+            if (TreeUtil.getString(tree, REP_PRINCIPAL_NAME) == null) {
                 fail("Mandatory property rep:principalName missing.");
             }
         }
-        return new UserValidator(null, node, provider);
+        return new UserValidator(null, tree, provider);
     }
 
     @Override
@@ -141,7 +142,7 @@ class UserValidator extends DefaultValid
 
     @Override
     public Validator childNodeDeleted(String name, NodeState before) throws CommitFailedException
{
-        NodeUtil node = parentBefore.getChild(name);
+        Tree node = parentBefore.getChild(name);
         if (isAdminUser(node)) {
             String msg = "The admin user cannot be removed.";
             fail(msg);
@@ -151,40 +152,40 @@ class UserValidator extends DefaultValid
 
     //------------------------------------------------------------< private >---
 
-    private boolean isAdminUser(@Nullable NodeUtil userNode) {
-        if (userNode != null && isUser(userNode)) {
-            String id = UserProvider.getAuthorizableId(userNode.getTree());
+    private boolean isAdminUser(@Nullable Tree userTree) {
+        if (userTree != null && isUser(userTree)) {
+            String id = UserProvider.getAuthorizableId(userTree);
             return UserUtility.getAdminId(provider.getConfig()).equals(id);
         } else {
             return false;
         }
     }
 
-    private static boolean isValidUUID(@Nonnull NodeUtil parent, @Nonnull String uuid) {
-        String id = UserProvider.getAuthorizableId(parent.getTree());
+    private static boolean isValidUUID(@Nonnull Tree parent, @Nonnull String uuid) {
+        String id = UserProvider.getAuthorizableId(parent);
         return uuid.equals(UserProvider.getContentID(id));
     }
 
-    private static boolean isUser(@Nullable NodeUtil node) {
-        return node != null && node.hasPrimaryNodeTypeName(NT_REP_USER);
+    private static boolean isUser(@Nullable Tree tree) {
+        return tree != null && NT_REP_USER.equals(TreeUtil.getPrimaryTypeName(tree));
     }
 
     /**
      * Make sure user and group nodes are located underneath the configured path
      * and that path consists of rep:authorizableFolder nodes.
      *
-     * @param node           The node representing a user or group.
+     * @param tree           The tree representing a user or group.
      * @param pathConstraint The path constraint.
      * @throws CommitFailedException If the hierarchy isn't valid.
      */
-    private static void assertHierarchy(@Nonnull NodeUtil node, @Nonnull String pathConstraint)
throws CommitFailedException {
-        if (!Text.isDescendant(pathConstraint, node.getTree().getPath())) {
+    private static void assertHierarchy(@Nonnull Tree tree, @Nonnull String pathConstraint)
throws CommitFailedException {
+        if (!Text.isDescendant(pathConstraint, tree.getPath())) {
             String msg = "Attempt to create user/group outside of configured scope " + pathConstraint;
             fail(msg);
         }
-        NodeUtil parent = node.getParent();
-        while (parent != null && !parent.getTree().isRoot()) {
-            if (!parent.hasPrimaryNodeTypeName(NT_REP_AUTHORIZABLE_FOLDER)) {
+        Tree parent = tree.getParent();
+        while (parent != null && !parent.isRoot()) {
+            if (!NT_REP_AUTHORIZABLE_FOLDER.equals(TreeUtil.getPrimaryTypeName(parent)))
{
                 String msg = "Cannot create user/group: Intermediate folders must be of type
rep:AuthorizableFolder.";
                 fail(msg);
             }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserValidatorProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserValidatorProvider.java?rev=1441129&r1=1441128&r2=1441129&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserValidatorProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserValidatorProvider.java
Thu Jan 31 19:03:22 2013
@@ -23,7 +23,6 @@ import org.apache.jackrabbit.oak.spi.com
 import org.apache.jackrabbit.oak.spi.commit.ValidatorProvider;
 import org.apache.jackrabbit.oak.spi.security.ConfigurationParameters;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
-import org.apache.jackrabbit.oak.util.NodeUtil;
 
 import static com.google.common.base.Preconditions.checkNotNull;
 
@@ -42,11 +41,7 @@ class UserValidatorProvider implements V
     @Nonnull
     @Override
     public Validator getRootValidator(NodeState before, NodeState after) {
-
-        NodeUtil rootBefore = new NodeUtil(new ReadOnlyTree(before));
-        NodeUtil rootAfter = new NodeUtil(new ReadOnlyTree(after));
-
-        return new UserValidator(rootBefore, rootAfter, this);
+        return new UserValidator(new ReadOnlyTree(before), new ReadOnlyTree(after), this);
     }
 
     //-----------------------------------------------------------< internal >---

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/user/util/UserUtility.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/user/util/UserUtility.java?rev=1441129&r1=1441128&r2=1441129&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/user/util/UserUtility.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/user/util/UserUtility.java
Thu Jan 31 19:03:22 2013
@@ -23,7 +23,7 @@ import org.apache.jackrabbit.oak.api.Tre
 import org.apache.jackrabbit.oak.spi.security.ConfigurationParameters;
 import org.apache.jackrabbit.oak.spi.security.user.AuthorizableType;
 import org.apache.jackrabbit.oak.spi.security.user.UserConstants;
-import org.apache.jackrabbit.oak.util.NodeUtil;
+import org.apache.jackrabbit.oak.util.TreeUtil;
 import org.apache.jackrabbit.util.Text;
 
 /**
@@ -47,7 +47,7 @@ public final class UserUtility implement
     public static boolean isType(Tree authorizableTree, AuthorizableType type) {
         // FIXME: check for node type according to the specified type constraint
         if (authorizableTree != null) {
-            String ntName = new NodeUtil(authorizableTree).getPrimaryNodeTypeName();
+            String ntName = TreeUtil.getPrimaryTypeName(authorizableTree);
             switch (type) {
                 case GROUP:
                     return NT_REP_GROUP.equals(ntName);
@@ -61,8 +61,8 @@ public final class UserUtility implement
     }
 
     @CheckForNull
-    public static AuthorizableType getType(@Nonnull NodeUtil authorizableNode) {
-        String ntName = authorizableNode.getPrimaryNodeTypeName();
+    public static AuthorizableType getType(@Nonnull Tree authorizableNode) {
+        String ntName = TreeUtil.getPrimaryTypeName(authorizableNode);
         if (ntName != null) {
             if (UserConstants.NT_REP_GROUP.equals(ntName)) {
                 return AuthorizableType.GROUP;



Mime
View raw message