jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1336286 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/KernelPrincipalProvider.java oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/principal/PrincipalManagerImpl.java
Date Wed, 09 May 2012 16:36:13 GMT
Author: angela
Date: Wed May  9 16:36:13 2012
New Revision: 1336286

URL: http://svn.apache.org/viewvc?rev=1336286&view=rev
Log:
OAK-90 - Implement Principal Management (WIP)

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/KernelPrincipalProvider.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/principal/PrincipalManagerImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/KernelPrincipalProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/KernelPrincipalProvider.java?rev=1336286&r1=1336285&r2=1336286&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/KernelPrincipalProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/KernelPrincipalProvider.java
Wed May  9 16:36:13 2012
@@ -40,7 +40,8 @@ public class KernelPrincipalProvider imp
 
     @Override
     public Principal getPrincipal(final String principalName) {
-        // TODO
+        // TODO: use user-defined query to search for a principalName property
+        // TODO  that is defined by a user/group node.
         return new Principal() {
             @Override
             public String getName() {

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/principal/PrincipalManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/principal/PrincipalManagerImpl.java?rev=1336286&r1=1336285&r2=1336286&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/principal/PrincipalManagerImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/principal/PrincipalManagerImpl.java
Wed May  9 16:36:13 2012
@@ -19,6 +19,7 @@ package org.apache.jackrabbit.oak.jcr.se
 import org.apache.jackrabbit.api.security.principal.PrincipalIterator;
 import org.apache.jackrabbit.api.security.principal.PrincipalManager;
 import org.apache.jackrabbit.oak.security.principal.EveryonePrincipal;
+import org.apache.jackrabbit.oak.spi.security.principal.PrincipalProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -34,16 +35,20 @@ public class PrincipalManagerImpl implem
      */
     private static final Logger log = LoggerFactory.getLogger(PrincipalManagerImpl.class);
 
+    private final PrincipalProvider principalProvider;
+
+    public PrincipalManagerImpl(PrincipalProvider principalProvider) {
+        this.principalProvider = principalProvider;
+    }
+
     @Override
     public boolean hasPrincipal(String principalName) {
-        // TODO
-        return false;
+        return principalProvider.getPrincipal(principalName) != null;
     }
 
     @Override
     public Principal getPrincipal(String principalName) {
-        // TODO
-        return null;
+        return principalProvider.getPrincipal(principalName);
     }
 
     @Override
@@ -66,8 +71,7 @@ public class PrincipalManagerImpl implem
 
     @Override
     public PrincipalIterator getGroupMembership(Principal principal) {
-        // TODO
-        return null;
+        return new PrincipalIteratorAdapter(principalProvider.getGroupMembership(principal));
     }
 
     @Override



Mime
View raw message