@@ -9,53 +9,18 @@ To guarantee that a user reads only their own documents, it makes sense to set u
9
9
document level security. In this scenario, each document must have the username
10
10
or role name associated with it, so that this information can be used by the
11
11
role 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.
13
13
14
14
NOTE: Document level security doesn't apply to write APIs. You must use unique
15
15
ids for each user that uses the same index, otherwise they might overwrite other
16
16
users' documents. The ingest processor just adds properties for the current
17
17
authenticated user to the documents that are being indexed.
18
18
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
20
20
`username`, `roles`, `email`, `full_name` and `metadata` ) from the current
21
21
authenticated user to the current document by pre-processing the ingest. When
22
22
you index data with an ingest pipeline, user details are automatically attached
23
- to the document. For example:
23
+ to the document.
24
24
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].
33
26
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