jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1539287 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core: SecureNodeBuilder.java SecureNodeState.java
Date Wed, 06 Nov 2013 09:42:54 GMT
Author: angela
Date: Wed Nov  6 09:42:53 2013
New Revision: 1539287

URL: http://svn.apache.org/r1539287
Log:
OAK-1147 : SecureNodeBuilder/SecureNodeState: Consider using 'TreePermission#canReadProperties'

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SecureNodeBuilder.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SecureNodeState.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SecureNodeBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SecureNodeBuilder.java?rev=1539287&r1=1539286&r2=1539287&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SecureNodeBuilder.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SecureNodeBuilder.java
Wed Nov  6 09:42:53 2013
@@ -179,7 +179,7 @@ class SecureNodeBuilder implements NodeB
 
     @Override
     public synchronized long getPropertyCount() {
-        if (getTreePermission().canReadAll()) {
+        if (getTreePermission().canReadProperties()) {
             return builder.getPropertyCount();
         } else {
             return size(filter(
@@ -190,14 +190,12 @@ class SecureNodeBuilder implements NodeB
 
     @Override @Nonnull
     public Iterable<? extends PropertyState> getProperties() {
-        if (getTreePermission().canReadAll()) {
+        if (getTreePermission().canReadProperties()) {
             return builder.getProperties();
-        } else if (getTreePermission().canRead()) { // TODO: check DENY_PROPERTIES?
+        } else {
             return filter(
                     builder.getProperties(),
                     new ReadablePropertyPredicate());
-        } else {
-            return emptyList();
         }
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SecureNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SecureNodeState.java?rev=1539287&r1=1539286&r2=1539287&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SecureNodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SecureNodeState.java
Wed Nov  6 09:42:53 2013
@@ -89,7 +89,7 @@ class SecureNodeState extends AbstractNo
     @Override
     public synchronized long getPropertyCount() {
         if (propertyCount == -1) {
-            if (treePermission.canReadAll()) {
+            if (treePermission.canReadProperties()) {
                 propertyCount = state.getPropertyCount();
             } else {
                 propertyCount = count(filter(
@@ -102,14 +102,12 @@ class SecureNodeState extends AbstractNo
 
     @Override @Nonnull
     public Iterable<? extends PropertyState> getProperties() {
-        if (treePermission.canReadAll()) {
+        if (treePermission.canReadProperties()) {
             return state.getProperties();
-        } else if (treePermission.canRead()) { // TODO: check DENY_PROPERTIES?
+        } else {
             return filter(
                     state.getProperties(),
                     new ReadablePropertyPredicate());
-        } else {
-            return emptyList();
         }
     }
 



Mime
View raw message