jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1521859 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/accesscontrol/ACE.java
Date Wed, 11 Sep 2013 14:10:16 GMT
Author: angela
Date: Wed Sep 11 14:10:16 2013
New Revision: 1521859

URL: http://svn.apache.org/r1521859
Log:
OAK-51 : Access Control Management

- simplify restrictions

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/accesscontrol/ACE.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/accesscontrol/ACE.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/accesscontrol/ACE.java?rev=1521859&r1=1521858&r2=1521859&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/accesscontrol/ACE.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/accesscontrol/ACE.java
Wed Sep 11 14:10:16 2013
@@ -112,7 +112,7 @@ public class ACE implements JackrabbitAc
         return Collections2.transform(restrictions, new Function<Restriction, String>()
{
             @Override
             public String apply(Restriction restriction) {
-                return namePathMapper.getJcrName(restriction.getName());
+                return getJcrName(restriction);
             }
         }).toArray(new String[restrictions.size()]);
     }
@@ -121,10 +121,9 @@ public class ACE implements JackrabbitAc
     @Override
     public Value getRestriction(String restrictionName) throws RepositoryException {
         for (Restriction restriction : restrictions) {
-            String jcrName = namePathMapper.getJcrName(restriction.getName());
+            String jcrName = getJcrName(restriction);
             if (jcrName.equals(restrictionName)) {
-
-                if (restriction.getRequiredType().isArray()) {
+                if (restriction.getDefinition().getRequiredType().isArray()) {
                     List<Value> values = ValueFactoryImpl.createValues(restriction.getProperty(),
namePathMapper);
                     switch (values.size()) {
                         case 1: return values.get(0);
@@ -142,7 +141,7 @@ public class ACE implements JackrabbitAc
     @Override
     public Value[] getRestrictions(String restrictionName) throws RepositoryException {
         for (Restriction restriction : restrictions) {
-            String jcrName = namePathMapper.getJcrName(restriction.getName());
+            String jcrName = getJcrName(restriction);
             if (jcrName.equals(restrictionName)) {
                 List<Value> values = ValueFactoryImpl.createValues(restriction.getProperty(),
namePathMapper);
                 return values.toArray(new Value[values.size()]);
@@ -205,4 +204,8 @@ public class ACE implements JackrabbitAc
         }
         return aggrPrivNames;
     }
+
+    private String getJcrName(Restriction restriction) {
+        return namePathMapper.getJcrName(restriction.getDefinition().getName());
+    }
 }



Mime
View raw message