geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [34/62] [abbrv] incubator-geode git commit: GEODE-1450: Move ExampleJSONAuthorization out of 'test' and into 'main'
Date Tue, 07 Jun 2016 20:54:49 GMT
GEODE-1450: Move ExampleJSONAuthorization out of 'test' and into 'main'


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/1aa39174
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/1aa39174
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/1aa39174

Branch: refs/heads/feature/GEODE-837
Commit: 1aa39174daa8ab2b2017013a62ff297fda7362e4
Parents: d24a5fb
Author: Jens Deppe <jdeppe@pivotal.io>
Authored: Thu Jun 2 10:46:59 2016 -0700
Committer: Jens Deppe <jdeppe@pivotal.io>
Committed: Thu Jun 2 10:46:59 2016 -0700

----------------------------------------------------------------------
 .../gemfire/security/templates/SampleJsonAuthorization.java | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1aa39174/geode-core/src/main/java/com/gemstone/gemfire/security/templates/SampleJsonAuthorization.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/security/templates/SampleJsonAuthorization.java
b/geode-core/src/main/java/com/gemstone/gemfire/security/templates/SampleJsonAuthorization.java
index 5723ea5..dca64e7 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/security/templates/SampleJsonAuthorization.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/security/templates/SampleJsonAuthorization.java
@@ -178,11 +178,10 @@ public class SampleJsonAuthorization implements AccessControl, Authenticator
{
 
       for (JsonNode op : r.get("operationsAllowed")) {
         String[] parts = op.asText().split(":");
-        if (regionNames == null) {
-          role.permissions.add(new ResourceOperationContext(parts[0], parts[1], "*", false));
-        } else {
-          role.permissions.add(new ResourceOperationContext(parts[0], parts[1], regionNames,
false));
-        }
+        String resourcePart = (parts.length > 0) ? parts[0] : null;
+        String operationPart = (parts.length > 1) ? parts[1] : null;
+        String regionPart = (regionNames != null) ? regionNames : "*";
+        role.permissions.add(new ResourceOperationContext(resourcePart, operationPart, regionPart,
false));
       }
 
       roleMap.put(role.name, role);


Mime
View raw message