You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by je...@apache.org on 2018/03/08 06:29:39 UTC

[geode] branch develop updated: GEODE-4385: Update help message for list jndi-binding (#1575)

This is an automated email from the ASF dual-hosted git repository.

jensdeppe pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 7630dba  GEODE-4385: Update help message for list jndi-binding (#1575)
7630dba is described below

commit 7630dba4f75341c5658cc8dd0415fea91389bd06
Author: Jens Deppe <jd...@pivotal.io>
AuthorDate: Wed Mar 7 22:29:36 2018 -0800

    GEODE-4385: Update help message for list jndi-binding (#1575)
    
    - Also add ResourcePermission for the same command
---
 .../management/internal/cli/commands/ListJndiBindingCommand.java   | 7 ++++++-
 .../org/apache/geode/management/internal/security/TestCommand.java | 6 ++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListJndiBindingCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListJndiBindingCommand.java
index 2634afb..09d7f1e 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListJndiBindingCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListJndiBindingCommand.java
@@ -30,15 +30,20 @@ import org.apache.geode.management.internal.cli.functions.CliFunctionResult;
 import org.apache.geode.management.internal.cli.functions.ListJndiBindingFunction;
 import org.apache.geode.management.internal.cli.result.ResultBuilder;
 import org.apache.geode.management.internal.cli.result.TabularResultData;
+import org.apache.geode.management.internal.security.ResourceOperation;
+import org.apache.geode.security.ResourcePermission;
 
 public class ListJndiBindingCommand implements GfshCommand {
   private static final Logger logger = LogService.getLogger();
 
   private static final String LIST_JNDIBINDING = "list jndi-binding";
-  private static final String LIST_JNDIBINDING__HELP = "List all jndi bindings.";
+  private static final String LIST_JNDIBINDING__HELP =
+      "List all active jndi bindings. An active binding is one that is bound to the server's jndi context.";
   private static final Function LIST_BINDING_FUNCTION = new ListJndiBindingFunction();
 
   @CliCommand(value = LIST_JNDIBINDING, help = LIST_JNDIBINDING__HELP)
+  @ResourceOperation(resource = ResourcePermission.Resource.CLUSTER,
+      operation = ResourcePermission.Operation.READ)
   public Result listJndiBinding() {
     Result result = null;
     TabularResultData tabularData = ResultBuilder.createTabularResultData();
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/security/TestCommand.java b/geode-core/src/test/java/org/apache/geode/management/internal/security/TestCommand.java
index 0fc858e..c5705c2 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/security/TestCommand.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/security/TestCommand.java
@@ -274,5 +274,11 @@ public class TestCommand {
 
     // ShellCommand
     createTestCommand("disconnect");
+
+    // JNDI Commands
+    createTestCommand(
+        "create jndi-binding --name=jndi1 --type=SIMPLE --jdbc-driver-class=org.apache.derby.jdbc.EmbeddedDriver --connection-url=\"jdbc:derby:newDB;create=true\"",
+        ResourcePermissions.CLUSTER_MANAGE);
+    createTestCommand("list jndi-binding", ResourcePermissions.CLUSTER_READ);
   }
 }

-- 
To stop receiving notification emails like this one, please contact
jensdeppe@apache.org.