geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [04/10] incubator-geode git commit: GEODE-1680: Change "list regions" to DATA:READ permissions
Date Fri, 22 Jul 2016 05:17:42 GMT
GEODE-1680: Change "list regions" to DATA:READ permissions

Edited the annotations for listRegions in RegionCommands and updated unit tests.

* this closes #214


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

Branch: refs/heads/feature/GEODE-1673-PR-212
Commit: 4a9c6ea0b4f096aabe54e3f30ceeb24aa622937b
Parents: 50aedb1
Author: Kevin J. Duling <kduling@pivotal.io>
Authored: Wed Jul 20 11:50:22 2016 -0700
Committer: Jinmei Liao <jiliao@pivotal.io>
Committed: Thu Jul 21 08:42:35 2016 -0700

----------------------------------------------------------------------
 .../internal/cli/commands/RegionCommands.java       | 16 ++++++++--------
 .../management/internal/security/TestCommand.java   |  2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4a9c6ea0/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/RegionCommands.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/RegionCommands.java
b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/RegionCommands.java
index e2e9e12..9114fc8 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/RegionCommands.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/RegionCommands.java
@@ -24,6 +24,13 @@ import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
 
+import org.apache.geode.security.GeodePermission.Operation;
+import org.apache.geode.security.GeodePermission.Resource;
+import org.springframework.shell.core.CommandMarker;
+import org.springframework.shell.core.annotation.CliAvailabilityIndicator;
+import org.springframework.shell.core.annotation.CliCommand;
+import org.springframework.shell.core.annotation.CliOption;
+
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.cache.Region;
@@ -50,13 +57,6 @@ import com.gemstone.gemfire.management.internal.cli.result.TabularResultData;
 import com.gemstone.gemfire.management.internal.cli.shell.Gfsh;
 import com.gemstone.gemfire.management.internal.cli.util.RegionAttributesNames;
 import com.gemstone.gemfire.management.internal.security.ResourceOperation;
-import org.apache.geode.security.GeodePermission.Operation;
-import org.apache.geode.security.GeodePermission.Resource;
-
-import org.springframework.shell.core.CommandMarker;
-import org.springframework.shell.core.annotation.CliAvailabilityIndicator;
-import org.springframework.shell.core.annotation.CliCommand;
-import org.springframework.shell.core.annotation.CliOption;
 
 /***
  * Class containing implementation of commands based on region:
@@ -77,7 +77,7 @@ public class RegionCommands implements CommandMarker {
 
   @CliCommand(value = { CliStrings.LIST_REGION }, help = CliStrings.LIST_REGION__HELP)
   @CliMetaData(shellOnly = false, relatedTopic = CliStrings.TOPIC_GEODE_REGION)
-  @ResourceOperation(resource = Resource.CLUSTER, operation = Operation.READ)
+  @ResourceOperation(resource = Resource.DATA, operation = Operation.READ)
   public Result listRegion(
       @CliOption(key = { CliStrings.LIST_REGION__GROUP },
       optionContext = ConverterHint.MEMBERGROUP,

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4a9c6ea0/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/TestCommand.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/TestCommand.java
b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/TestCommand.java
index d3d14d5..8c8ed40 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/TestCommand.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/TestCommand.java
@@ -191,7 +191,7 @@ public class TestCommand {
 
     //RegionCommands
     createTestCommand("describe region --name=value", clusterRead);
-    createTestCommand("list regions", clusterRead);
+    createTestCommand("list regions", dataRead);
 
     // StatusCommands
     createTestCommand("status cluster-config-service", clusterRead);


Mime
View raw message