@@ -9,53 +9,18 @@ To guarantee that a user reads only their own documents, it makes sense to set u
99document level security. In this scenario, each document must have the username
1010or role name associated with it, so that this information can be used by the
1111role query for document level security. This is a situation where the
12- `set_security_user` ingest processor can help.
12+ {ref}/ingest-node-set-security-user-processor.html[Set Security User Processor] ingest processor can help.
1313
1414NOTE: Document level security doesn't apply to write APIs. You must use unique
1515ids for each user that uses the same index, otherwise they might overwrite other
1616users' documents. The ingest processor just adds properties for the current
1717authenticated user to the documents that are being indexed.
1818
19- The `set_security_user` processor attaches user-related details (such as
19+ The {ref}/ingest-node-set-security-user-processor.html[set security user processor] attaches user-related details (such as
2020`username`, `roles`, `email`, `full_name` and `metadata` ) from the current
2121authenticated user to the current document by pre-processing the ingest. When
2222you index data with an ingest pipeline, user details are automatically attached
23- to the document. For example:
23+ to the document.
2424
25- [source,js]
26- --------------------------------------------------
27- PUT shared-logs/log/1?pipeline=my_pipeline_id
28- {
29- ...
30- }
31- --------------------------------------------------
32- // NOTCONSOLE
25+ For more information see {ref}/ingest.html[Ingest node] and {ref}/ingest-node-set-security-user-processor.html[Set security user processor].
3326
34- For more information about setting up a pipeline and other processors, see
35- {ref}/ingest.html[ingest node].
36-
37- [[set-security-user-options]]
38- .Set Security User Options
39- [options="header"]
40- |======
41- | Name | Required | Default | Description
42- | `field` | yes | - | The field to store the user information into.
43- | `properties` | no | [`username`, `roles`, `email`, `full_name`, `metadata`] | Controls what user related properties are added to the `field`.
44- |======
45-
46- The following example adds all user details for the current authenticated user
47- to the `user` field for all documents that are processed by this pipeline:
48-
49- [source,js]
50- --------------------------------------------------
51- {
52- "processors" : [
53- {
54- "set_security_user": {
55- "field": "user"
56- }
57- }
58- ]
59- }
60- --------------------------------------------------
61- // NOTCONSOLE
0 commit comments