You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sh...@apache.org on 2017/06/27 05:19:30 UTC

[19/27] lucene-solr:feature/autoscaling: Ref Guide: fix bad JSON in examples

Ref Guide: fix bad JSON in examples


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/8da926e7
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/8da926e7
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/8da926e7

Branch: refs/heads/feature/autoscaling
Commit: 8da926e7cb08b39a100448e385b8c068f94eedec
Parents: 9f56698
Author: Cassandra Targett <ct...@apache.org>
Authored: Mon Jun 26 20:24:48 2017 -0500
Committer: Cassandra Targett <ct...@apache.org>
Committed: Mon Jun 26 22:17:59 2017 -0500

----------------------------------------------------------------------
 .../src/rule-based-authorization-plugin.adoc    | 23 +++++++-------------
 1 file changed, 8 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8da926e7/solr/solr-ref-guide/src/rule-based-authorization-plugin.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/rule-based-authorization-plugin.adoc b/solr/solr-ref-guide/src/rule-based-authorization-plugin.adoc
index 5b548f2..ee2fd88 100644
--- a/solr/solr-ref-guide/src/rule-based-authorization-plugin.adoc
+++ b/solr/solr-ref-guide/src/rule-based-authorization-plugin.adoc
@@ -152,8 +152,9 @@ For example, this property could be used to limit the actions a role is allowed
 +
 [source,json]
 ----
-"params": {
+{"params": {
    "action": ["LIST", "CLUSTERSTATUS"]
+  }
 }
 ----
 +
@@ -163,8 +164,9 @@ If the commands LIST and CLUSTERSTATUS are case insensitive, the above example s
 +
 [source,json]
 ----
-"params": {
+{"params": {
    "action": ["REGEX:(?i)LIST", "REGEX:(?i)CLUSTERSTATUS"]
+  }
 }
 ----
 
@@ -177,25 +179,21 @@ The name of the role(s) to give this permission. This name will be used to map u
 The following creates a new permission named "collection-mgr" that is allowed to create and list collections. The permission will be placed before the "read" permission. Note also that we have defined "collection as `null`, this is because requests to the Collections API are never collection-specific.
 
 [source,bash]
-----
 curl --user solr:SolrRocks -H 'Content-type:application/json' -d '{
   "set-permission": {"collection": null,
                      "path":"/admin/collections",
-                     "params":{"action":[LIST, CREATE]},
+                     "params":{"action":["LIST", "CREATE"]},
                      "before": 3,
                      "role": "admin"}
 }' http://localhost:8983/solr/admin/authorization
-----
 
 Apply an update permission on all collections to a role called `dev` and read permissions to a role called `guest`:
 
 [source,bash]
-----
 curl --user solr:SolrRocks -H 'Content-type:application/json' -d '{
-  "set-permission": {"name": "update, "role":"dev"},
-  "set-permission": {"name": "read, "role":"guest"},
+  "set-permission": {"name": "update", "role":"dev"},
+  "set-permission": {"name": "read", "role":"guest"}
 }' http://localhost:8983/solr/admin/authorization
-----
 
 [[Rule-BasedAuthorizationPlugin-UpdateorDeletePermissions]]
 === Update or Delete Permissions
@@ -205,21 +203,18 @@ Permissions can be accessed using their index in the list. Use the `/admin/autho
 The following example updates the `'role'` attribute of permission at index `3`:
 
 [source,bash]
-----
 curl --user solr:SolrRocks -H 'Content-type:application/json' -d '{
   "update-permission": {"index": 3,
                        "role": ["admin", "dev"]}
 }' http://localhost:8983/solr/admin/authorization
-----
 
 The following example deletes permission at index `3`:
 
 [source,bash]
-----
 curl --user solr:SolrRocks -H 'Content-type:application/json' -d '{
   "delete-permission": 3
 }' http://localhost:8983/solr/admin/authorization
-----
+
 
 [[Rule-BasedAuthorizationPlugin-MapRolestoUsers]]
 === Map Roles to Users
@@ -235,9 +230,7 @@ The values supplied to the command are simply a user ID and one or more roles th
 For example, the following would grant a user "solr" the "admin" and "dev" roles, and remove all roles from the user ID "harry":
 
 [source,bash]
-----
 curl -u solr:SolrRocks -H 'Content-type:application/json' -d '{
    "set-user-role" : {"solr": ["admin","dev"],
                       "harry": null}
 }' http://localhost:8983/solr/admin/authorization
-----