jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1411735 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: security/user/UserConfigurationImpl.java security/user/UserContext.java spi/security/Context.java spi/security/SecurityConfiguration.java
Date Tue, 20 Nov 2012 16:46:04 GMT
Author: angela
Date: Tue Nov 20 16:46:01 2012
New Revision: 1411735

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

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserConfigurationImpl.java
    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/spi/security/Context.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/SecurityConfiguration.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserConfigurationImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserConfigurationImpl.java?rev=1411735&r1=1411734&r2=1411735&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserConfigurationImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserConfigurationImpl.java
Tue Nov 20 16:46:01 2012
@@ -78,7 +78,7 @@ public class UserConfigurationImpl exten
     @Nonnull
     @Override
     public Context getContext() {
-        return new UserContext();
+        return UserContext.INSTANCE;
     }
 
     //--------------------------------------------------< UserConfiguration >---
@@ -100,4 +100,4 @@ public class UserConfigurationImpl exten
     public UserManager getUserManager(Root root, NamePathMapper namePathMapper) {
         return new UserManagerImpl(null, root, namePathMapper, securityProvider);
     }
-}
\ No newline at end of file
+}

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=1411735&r1=1411734&r2=1411735&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
Tue Nov 20 16:46:01 2012
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.oak.security.user;
 
-import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.spi.security.Context;
@@ -28,11 +27,14 @@ import org.apache.jackrabbit.oak.util.No
  */
 class UserContext implements Context {
 
+    static final Context INSTANCE = new UserContext();
+
+    private UserContext() {}
     //------------------------------------------------------------< Context >---
     @Override
     public boolean definesProperty(Tree parent, PropertyState property) {
         NodeUtil node = new NodeUtil(parent);
-        String ntName = node.getName(JcrConstants.JCR_PRIMARYTYPE);
+        String ntName = node.getPrimaryNodeTypeName();
         if (UserConstants.NT_REP_USER.equals(ntName)) {
             return UserConstants.USER_PROPERTY_NAMES.contains(property.getName());
         } else if (UserConstants.NT_REP_GROUP.equals(ntName)) {
@@ -46,13 +48,7 @@ class UserContext implements Context {
     @Override
     public boolean definesTree(Tree tree) {
         NodeUtil node = new NodeUtil(tree);
-        String ntName = node.getName(JcrConstants.JCR_PRIMARYTYPE);
+        String ntName = node.getPrimaryNodeTypeName();
         return UserConstants.NT_REP_GROUP.equals(ntName) || UserConstants.NT_REP_USER.equals(ntName)
|| UserConstants.NT_REP_MEMBERS.equals(ntName);
     }
-
-    @Override
-    public boolean definesItems(String path) {
-        // TODO
-        return false;
-    }
 }
\ No newline at end of file

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/Context.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/Context.java?rev=1411735&r1=1411734&r2=1411735&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/Context.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/Context.java
Tue Nov 20 16:46:01 2012
@@ -27,6 +27,4 @@ public interface Context {
     boolean definesProperty(Tree parent, PropertyState property);
 
     boolean definesTree(Tree tree);
-
-    boolean definesItems(String path);
 }
\ No newline at end of file

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/SecurityConfiguration.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/SecurityConfiguration.java?rev=1411735&r1=1411734&r2=1411735&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/SecurityConfiguration.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/SecurityConfiguration.java
Tue Nov 20 16:46:01 2012
@@ -98,11 +98,6 @@ public interface SecurityConfiguration {
                 public boolean definesTree(Tree tree) {
                     return false;
                 }
-
-                @Override
-                public boolean definesItems(String path) {
-                    return false;
-                }
             };
         }
     }



Mime
View raw message