You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ct...@apache.org on 2017/06/27 03:22:50 UTC
lucene-solr:branch_6x: Ref Guide: fix bad JSON in examples
Repository: lucene-solr
Updated Branches:
refs/heads/branch_6x 735365e7e -> e2bc5749b
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/e2bc5749
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/e2bc5749
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/e2bc5749
Branch: refs/heads/branch_6x
Commit: e2bc5749b071e02bdb76938649b05adaad348d52
Parents: 735365e
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:22:27 2017 -0500
----------------------------------------------------------------------
.../src/rule-based-authorization-plugin.adoc | 25 +++++++-------------
1 file changed, 9 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e2bc5749/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 d397244..1cfdbb4 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"]
+ }
}
----
@@ -175,25 +177,21 @@ If the commands LIST and CLUSTERSTATUS are case insensitive, the above example s
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]},
- "before: 3,
+ "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
@@ -203,21 +201,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
@@ -233,9 +228,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
-----