jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1441142 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: security/authorization/permission/CompiledPermissionImpl.java spi/security/authorization/OpenPermissionProvider.java
Date Thu, 31 Jan 2013 19:13:37 GMT
Author: angela
Date: Thu Jan 31 19:13:36 2013
New Revision: 1441142

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

Modified:
    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/OpenPermissionProvider.java

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=1441142&r1=1441141&r2=1441142&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 19:13:36 2013
@@ -51,7 +51,9 @@ public class CompiledPermissionImpl impl
         EntriesBuilder builder = new EntriesBuilder();
         for (Principal principal : principals) {
             Tree t = permissionsTree.getChild(Text.escapeIllegalJcrChars(principal.getName()));
-            builder.addEntry(principal, t);
+            if (t != null) {
+                builder.addEntry(principal, t);
+            }
         }
         userEntries = builder.userEntries.build();
         groupEntries = builder.groupEntries.build();
@@ -117,7 +119,7 @@ public class CompiledPermissionImpl impl
         private final List<String> restrictions;
         private final long permissions;
 
-        Entry(NodeUtil node) {
+        private Entry(NodeUtil node) {
             isAllow = node.hasPrimaryNodeTypeName(NT_REP_GRANT_ACE);
             privilegeNames = node.getStrings(REP_PRIVILEGES);
             restrictions = null; // TODO
@@ -128,10 +130,10 @@ public class CompiledPermissionImpl impl
 
     private static final class EntriesBuilder {
 
-        ImmutableSortedMap.Builder<Key, Entry> userEntries = ImmutableSortedMap.naturalOrder();
-        ImmutableSortedMap.Builder<Key, Entry> groupEntries = ImmutableSortedMap.naturalOrder();
+        private ImmutableSortedMap.Builder<Key, Entry> userEntries = ImmutableSortedMap.naturalOrder();
+        private ImmutableSortedMap.Builder<Key, Entry> groupEntries = ImmutableSortedMap.naturalOrder();
 
-        private void addEntry(Principal principal, Tree entryTree) {
+        private void addEntry(@Nonnull Principal principal, @Nonnull Tree entryTree) {
             NodeUtil node = new NodeUtil(entryTree);
             Entry entry = new Entry(node);
             if (entry.permissions != Permissions.NO_PERMISSION) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/OpenPermissionProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/OpenPermissionProvider.java?rev=1441142&r1=1441141&r2=1441142&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/OpenPermissionProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/OpenPermissionProvider.java
Thu Jan 31 19:13:36 2013
@@ -28,7 +28,7 @@ import org.apache.jackrabbit.oak.securit
 /**
  * OpenPermissionProvider... TODO
  */
-public class OpenPermissionProvider implements PermissionProvider {
+public final class OpenPermissionProvider implements PermissionProvider {
 
     private static final PermissionProvider INSTANCE = new OpenPermissionProvider();
 



Mime
View raw message