jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1440915 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: core/ plugins/version/ security/authorization/ security/authorization/permission/ spi/security/authorization/
Date Thu, 31 Jan 2013 11:28:41 GMT
Author: angela
Date: Thu Jan 31 11:28:40 2013
New Revision: 1440915

URL: http://svn.apache.org/viewvc?rev=1440915&view=rev
Log:
OAK-51 : Access Control Management (WIP)

- move SimpleRoot from plugins/version to the core package in order to be able to create a
tmp root instance in the PermissionValidator

Added:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ReadOnlyRoot.java
  (contents, props changed)
      - copied, changed from r1440887, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/SimpleRoot.java
Removed:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/SimpleRoot.java
Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ReadOnlyTree.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadOnlyVersionManager.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadWriteVersionManager.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/AccessControlConfigurationImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/PermissionProviderImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/PermissionValidator.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/PermissionValidatorProvider.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/TmpPermissionProvider.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/CompiledPermissionImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/AccessControlConfiguration.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/OpenAccessControlConfiguration.java

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ReadOnlyRoot.java
(from r1440887, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/SimpleRoot.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ReadOnlyRoot.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ReadOnlyRoot.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/SimpleRoot.java&r1=1440887&r2=1440915&rev=1440915&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/SimpleRoot.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ReadOnlyRoot.java
Thu Jan 31 11:28:40 2013
@@ -16,40 +16,48 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.jackrabbit.oak.plugins.version;
+package org.apache.jackrabbit.oak.core;
 
 import javax.annotation.Nonnull;
 
 import org.apache.jackrabbit.oak.api.BlobFactory;
-import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.QueryEngine;
 import org.apache.jackrabbit.oak.api.Root;
-import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.api.TreeLocation;
+import org.apache.jackrabbit.oak.commons.PathUtils;
+import org.apache.jackrabbit.oak.spi.state.NodeState;
 
 import static com.google.common.base.Preconditions.checkArgument;
 
 /**
- * TODO document
+ * Simple implementation of the Root interface that only supports simple read
+ * operations (excluding query) based on the NodeState (or ReadOnly tree)
+ * passed to the constructor.
+ * <p/>
+ * TODO: proper handle node state lifecycle that has an impact on this root.
  */
-class SimpleRoot implements Root {
+public final class ReadOnlyRoot implements Root {
 
-    private final Tree rootTree;
+    private final ReadOnlyTree rootTree;
 
-    SimpleRoot(Tree rootTree) {
+    public ReadOnlyRoot(NodeState rootState) {
+        this(new ReadOnlyTree(rootState));
+    }
+
+    public ReadOnlyRoot(ReadOnlyTree rootTree) {
         checkArgument(rootTree.isRoot());
         this.rootTree = rootTree;
     }
 
     @Override
-    public Tree getTree(String path) {
-        return getLocation(path).getTree();
+    public ReadOnlyTree getTree(String path) {
+        return (ReadOnlyTree) getLocation(path).getTree();
     }
 
     @Nonnull
     @Override
     public TreeLocation getLocation(String path) {
-        checkArgument(path.startsWith("/"));
+        checkArgument(PathUtils.isAbsolute(path));
         return rootTree.getLocation().getChild(path.substring(1));
     }
 
@@ -76,7 +84,7 @@ class SimpleRoot implements Root {
     }
 
     @Override
-    public void commit() throws CommitFailedException {
+    public void commit() {
         throw new UnsupportedOperationException();
     }
 

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ReadOnlyRoot.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ReadOnlyRoot.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ReadOnlyTree.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ReadOnlyTree.java?rev=1440915&r1=1440914&r2=1440915&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ReadOnlyTree.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ReadOnlyTree.java
Thu Jan 31 11:28:40 2013
@@ -83,22 +83,13 @@ public class ReadOnlyTree implements Tre
     public static ReadOnlyTree createFromRoot(Root root) {
         if (root instanceof RootImpl) {
             return new ReadOnlyTree(((RootImpl) root).getBaseState());
+        } else if (root instanceof ReadOnlyRoot) {
+            return ((ReadOnlyRoot) root).getTree("/");
         } else {
             throw new IllegalArgumentException("Unsupported Root implementation.");
         }
     }
 
-    public static ReadOnlyTree createFromRootTree(Tree rootTree) {
-        if (rootTree instanceof ReadOnlyTree) {
-            return (ReadOnlyTree) rootTree;
-        } else if (rootTree instanceof TreeImpl) {
-            TreeImpl impl = (TreeImpl) rootTree;
-            return new ReadOnlyTree(null, "", impl.getNodeState());
-        } else {
-            throw new IllegalArgumentException("Unsupported Tree implementation");
-        }
-    }
-
     @Override
     public String getName() {
         return name;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadOnlyVersionManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadOnlyVersionManager.java?rev=1440915&r1=1440914&r2=1440915&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadOnlyVersionManager.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadOnlyVersionManager.java
Thu Jan 31 11:28:40 2013
@@ -22,7 +22,6 @@ import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
 import javax.jcr.RepositoryException;
 import javax.jcr.UnsupportedRepositoryOperationException;
-import javax.jcr.version.VersionManager;
 
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Root;
@@ -39,7 +38,7 @@ import static com.google.common.base.Pre
 
 /**
  * <code>ReadOnlyVersionManager</code> provides implementations for read-only
- * version operations modeled after the ones available in {@link VersionManager}.
+ * version operations modeled after the ones available in {@link javax.jcr.version.VersionManager}.
  */
 public abstract class ReadOnlyVersionManager {
 
@@ -165,7 +164,7 @@ public abstract class ReadOnlyVersionMan
 
     /**
      * @return an identifier manager that is able to resolve identifiers of
-     * nodes in the version storage.
+     *         nodes in the version storage.
      */
     protected IdentifierManager getIdentifierManager() {
         // FIXME: may need to revise this, because getVersionStorageTree()
@@ -226,7 +225,7 @@ public abstract class ReadOnlyVersionMan
      * @param tree the tree to check.
      * @return whether the <code>tree</code> is versionable.
      * @throws RepositoryException if an error occurs while checking the node
-     *              type of the tree.
+     *                             type of the tree.
      */
     protected boolean isVersionable(@Nonnull Tree tree) throws RepositoryException {
         checkNotNull(tree);

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadWriteVersionManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadWriteVersionManager.java?rev=1440915&r1=1440914&r2=1440915&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadWriteVersionManager.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadWriteVersionManager.java
Thu Jan 31 11:28:40 2013
@@ -29,6 +29,7 @@ import org.apache.jackrabbit.oak.api.Roo
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.commons.PathUtils;
+import org.apache.jackrabbit.oak.core.ReadOnlyRoot;
 import org.apache.jackrabbit.oak.core.ReadOnlyTree;
 import org.apache.jackrabbit.oak.namepath.NamePathMapper;
 import org.apache.jackrabbit.oak.plugins.identifier.IdentifierManager;
@@ -83,7 +84,7 @@ class ReadWriteVersionManager extends Re
     @Nonnull
     @Override
     protected Root getWorkspaceRoot() {
-        return new SimpleRoot(new ReadOnlyTree(workspaceRoot.getNodeState()));
+        return new ReadOnlyRoot(workspaceRoot.getNodeState());
     }
 
     @Nonnull

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/AccessControlConfigurationImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/AccessControlConfigurationImpl.java?rev=1440915&r1=1440914&r2=1440915&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/AccessControlConfigurationImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/AccessControlConfigurationImpl.java
Thu Jan 31 11:28:40 2013
@@ -25,7 +25,6 @@ import javax.annotation.Nonnull;
 import javax.jcr.security.AccessControlManager;
 
 import org.apache.jackrabbit.oak.api.Root;
-import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.namepath.NamePathMapper;
 import org.apache.jackrabbit.oak.security.authorization.restriction.RestrictionProviderImpl;
 import org.apache.jackrabbit.oak.spi.commit.CommitHook;
@@ -85,13 +84,6 @@ public class AccessControlConfigurationI
 
     @Nonnull
     @Override
-    public PermissionProvider getPermissionProvider(Tree rootTree, Set<Principal> principals)
{
-        // TODO OAK-51
-        return new TmpPermissionProvider(rootTree, principals, securityProvider);
-    }
-
-    @Nonnull
-    @Override
     public RepositoryInitializer getRepositoryInitializer() {
         return new AccessControlInitializer();
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/PermissionProviderImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/PermissionProviderImpl.java?rev=1440915&r1=1440914&r2=1440915&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/PermissionProviderImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/PermissionProviderImpl.java
Thu Jan 31 11:28:40 2013
@@ -49,12 +49,14 @@ import org.slf4j.LoggerFactory;
 
 /**
  * PermissionProviderImpl... TODO
+ * <p/>
+ * FIXME: permissions need to be refreshed if something changes in the permission tree
  */
 public class PermissionProviderImpl implements PermissionProvider, AccessControlConstants
{
 
     private static final Logger log = LoggerFactory.getLogger(PermissionProviderImpl.class);
 
-    private final ReadOnlyTree rootTree;
+    private final Root root;
     private final SecurityProvider securityProvider;
 
     private final String workspaceName = "default"; // FIXME: use proper workspace as associated
with the root
@@ -63,18 +65,14 @@ public class PermissionProviderImpl impl
 
     public PermissionProviderImpl(@Nonnull Root root, @Nonnull Set<Principal> principals,
                                   @Nonnull SecurityProvider securityProvider) {
-        this(ReadOnlyTree.createFromRoot(root), principals, securityProvider);
-    }
-
-    public PermissionProviderImpl(@Nonnull Tree rootTree, @Nonnull Set<Principal> principals,
-                                  @Nonnull SecurityProvider securityProvider) {
-        this.rootTree = ReadOnlyTree.createFromRootTree(rootTree);
+        this.root = root;
         this.securityProvider = securityProvider;
         if (principals.contains(SystemPrincipal.INSTANCE) || isAdmin(principals)) {
             compiledPermissions = AllPermissions.getInstance();
         } else {
             String relativePath = PERMISSIONS_STORE_PATH + '/' + workspaceName;
-            ReadOnlyTree permissionsTree = getPermissionsRoot(this.rootTree, relativePath);
+            ReadOnlyTree rootTree = ReadOnlyTree.createFromRoot(root);
+            ReadOnlyTree permissionsTree = getPermissionsRoot(rootTree, relativePath);
             if (permissionsTree == null) {
                 compiledPermissions = NoPermissions.getInstance();
             } else {
@@ -153,7 +151,7 @@ public class PermissionProviderImpl impl
 
     @Override
     public boolean hasPermission(@Nonnull String oakPath, String jcrActions) {
-        TreeLocation location = rootTree.getLocation().getChild(oakPath.substring(1));
+        TreeLocation location = root.getLocation(oakPath);
         long permissions = Permissions.getPermissions(jcrActions, location);
 
         // TODO
@@ -248,8 +246,7 @@ public class PermissionProviderImpl impl
             log.warn("Unable to determine path of the versionable node.");
             return null;
         } else {
-            String relPath = versionablePath.substring(1);
-            return rootTree.getLocation().getChild(relPath).getTree();
+            return root.getLocation(versionablePath).getTree();
         }
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/PermissionValidator.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/PermissionValidator.java?rev=1440915&r1=1440914&r2=1440915&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/PermissionValidator.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/PermissionValidator.java
Thu Jan 31 11:28:40 2013
@@ -16,6 +16,7 @@
  */
 package org.apache.jackrabbit.oak.security.authorization;
 
+import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 import javax.jcr.AccessDeniedException;
 
@@ -27,8 +28,6 @@ import org.apache.jackrabbit.oak.spi.sec
 import org.apache.jackrabbit.oak.spi.security.authorization.Permissions;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 
-import static com.google.common.base.Preconditions.checkNotNull;
-
 /**
  * PermissionValidator... TODO
  */
@@ -98,9 +97,8 @@ class PermissionValidator implements Val
 
     //------------------------------------------------------------< private >---
 
-    private Validator checkPermissions(Tree tree, boolean isBefore, long defaultPermission)
throws CommitFailedException {
-        checkNotNull(tree);
-
+    private Validator checkPermissions(@Nonnull Tree tree, boolean isBefore,
+                                       long defaultPermission) throws CommitFailedException
{
         long permission = permissionProvider.getPermission(tree, defaultPermission);
         if (Permissions.isRepositoryPermission(permission)) {
             if (!permissionProvider.isGranted(permission)) {
@@ -117,7 +115,8 @@ class PermissionValidator implements Val
         }
     }
 
-    private void checkPermissions(Tree parent, PropertyState property, long defaultPermission)
throws CommitFailedException {
+    private void checkPermissions(@Nonnull Tree parent, @Nonnull PropertyState property,
+                                  long defaultPermission) throws CommitFailedException {
         long permission = permissionProvider.getPermission(parent, property, defaultPermission);
         if (!permissionProvider.isGranted(parent, property, permission)) {
             throw new CommitFailedException(new AccessDeniedException());

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/PermissionValidatorProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/PermissionValidatorProvider.java?rev=1440915&r1=1440914&r2=1440915&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/PermissionValidatorProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/PermissionValidatorProvider.java
Thu Jan 31 11:28:40 2013
@@ -23,6 +23,7 @@ import java.util.Set;
 import javax.annotation.Nonnull;
 import javax.security.auth.Subject;
 
+import org.apache.jackrabbit.oak.core.ReadOnlyRoot;
 import org.apache.jackrabbit.oak.core.ReadOnlyTree;
 import org.apache.jackrabbit.oak.spi.commit.Validator;
 import org.apache.jackrabbit.oak.spi.commit.ValidatorProvider;
@@ -49,9 +50,9 @@ class PermissionValidatorProvider implem
         Subject subject = Subject.getSubject(AccessController.getContext());
         Set<Principal> principals = (subject != null) ? subject.getPrincipals() : Collections.<Principal>emptySet();
 
-        ReadOnlyTree beforeTree = new ReadOnlyTree(before);
-        PermissionProvider pp = acConfiguration.getPermissionProvider(beforeTree, principals);
+        ReadOnlyRoot root = new ReadOnlyRoot(before);
+        PermissionProvider pp = acConfiguration.getPermissionProvider(root, principals);
 
-        return new PermissionValidator(beforeTree, new ReadOnlyTree(after), pp, this);
+        return new PermissionValidator(new ReadOnlyTree(before), new ReadOnlyTree(after),
pp, this);
     }
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/TmpPermissionProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/TmpPermissionProvider.java?rev=1440915&r1=1440914&r2=1440915&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/TmpPermissionProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/TmpPermissionProvider.java
Thu Jan 31 11:28:40 2013
@@ -40,11 +40,6 @@ class TmpPermissionProvider extends Perm
         isAdmin = principals.contains(SystemPrincipal.INSTANCE) || isAdmin(principals);
     }
 
-    public TmpPermissionProvider(@Nonnull Tree rootTree, @Nonnull Set<Principal> principals,
@Nonnull SecurityProvider securityProvider) {
-        super(rootTree, principals, securityProvider);
-        isAdmin = principals.contains(SystemPrincipal.INSTANCE) || isAdmin(principals);
-    }
-
     @Override
     public boolean canRead(@Nonnull Tree tree) {
         return true;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/CompiledPermissionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/CompiledPermissionImpl.java?rev=1440915&r1=1440914&r2=1440915&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/CompiledPermissionImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/permission/CompiledPermissionImpl.java
Thu Jan 31 11:28:40 2013
@@ -39,14 +39,13 @@ import static com.google.common.base.Pre
  */
 public class CompiledPermissionImpl implements CompiledPermissions, AccessControlConstants
{
 
-    private final ReadOnlyTree permissionsTree;
     private final Set<Principal> principals;
 
     private Map<Key, Entry> userEntries;
     private Map<Key, Entry> groupEntries;
 
-    public CompiledPermissionImpl(@Nonnull ReadOnlyTree permissionsTree, @Nonnull Set<Principal>
principals) {
-        this.permissionsTree = permissionsTree;
+    public CompiledPermissionImpl(@Nonnull ReadOnlyTree permissionsTree,
+                                  @Nonnull Set<Principal> principals) {
         this.principals = checkNotNull(principals);
 
         EntriesBuilder builder = new EntriesBuilder();

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/AccessControlConfiguration.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/AccessControlConfiguration.java?rev=1440915&r1=1440914&r2=1440915&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/AccessControlConfiguration.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/AccessControlConfiguration.java
Thu Jan 31 11:28:40 2013
@@ -22,7 +22,6 @@ import javax.annotation.Nonnull;
 import javax.jcr.security.AccessControlManager;
 
 import org.apache.jackrabbit.oak.api.Root;
-import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.namepath.NamePathMapper;
 import org.apache.jackrabbit.oak.spi.security.SecurityConfiguration;
 import org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionProvider;
@@ -38,11 +37,6 @@ public interface AccessControlConfigurat
     @Nonnull
     RestrictionProvider getRestrictionProvider(NamePathMapper namePathMapper);
 
-    // TODO: define how to pass workspace information
     @Nonnull
     PermissionProvider getPermissionProvider(Root root, Set<Principal> principals);
-
-    // TODO: check again
-    @Nonnull
-    PermissionProvider getPermissionProvider(Tree rootTree, Set<Principal> principals);
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/OpenAccessControlConfiguration.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/OpenAccessControlConfiguration.java?rev=1440915&r1=1440914&r2=1440915&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/OpenAccessControlConfiguration.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/OpenAccessControlConfiguration.java
Thu Jan 31 11:28:40 2013
@@ -22,7 +22,6 @@ import javax.annotation.Nonnull;
 import javax.jcr.security.AccessControlManager;
 
 import org.apache.jackrabbit.oak.api.Root;
-import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.namepath.NamePathMapper;
 import org.apache.jackrabbit.oak.spi.security.SecurityConfiguration;
 import org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionProvider;
@@ -51,9 +50,4 @@ public class OpenAccessControlConfigurat
         return OpenPermissionProvider.getInstance();
     }
 
-    @Nonnull
-    @Override
-    public PermissionProvider getPermissionProvider(Tree rootTree, Set<Principal> principals)
{
-        return OpenPermissionProvider.getInstance();
-    }
 }



Mime
View raw message