Skip to content

Commit ca8dfb7

Browse files
Clarify array vs object permission definitions [CTT-740] [v/5.6] (#2093)
Backport of #2086 Adds a note to `client-authorization` page discussing object vs array permissions, with a simple example. Fixes https://hazelcast.atlassian.net/browse/CTT-740 Co-authored-by: James Holgate <130981049+JamesHazelcast@users.noreply.github.com>
1 parent a395662 commit ca8dfb7

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

docs/modules/security/pages/client-authorization.adoc

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,18 @@ can be configured as required.
188188
189189
The following is the list of client permissions that can be configured on the member:
190190
191+
[NOTE]
192+
====
193+
In YAML configuration, permission types use one of two formats:
194+
195+
* **Single object format** (used by `all`, `config`, and `transaction`): These singleton permissions can only have one configuration entry, so they are defined directly as an object without the `-` list indicator.
196+
* **Array format** (used by all other permission types): These permissions support multiple entries with different `name` attributes or configurations, so each entry begins with a `-` to indicate it is a list item.
197+
198+
For example, `all: principal: admin` (single object) versus `map: - name: myMap` (array).
199+
200+
If you see an error like `expected type: JSONArray, found: JSONObject`, check whether you are using the correct format for the permission type.
201+
====
202+
191203
=== All permissions
192204

193205
`<all-permissions>` grants clients access to all data and features.
@@ -1150,7 +1162,7 @@ XML::
11501162
11511163
[source,xml]
11521164
----
1153-
<user-code-namespace-permission principal="principal">
1165+
<user-code-namespace-permission principal="principal" name="my_namespace">
11541166
<endpoints>
11551167
...
11561168
</endpoints>
@@ -1166,11 +1178,12 @@ YAML::
11661178
[source,yaml]
11671179
----
11681180
user-code-namespace:
1169-
principal: principal
1170-
endpoints:
1171-
- ..
1172-
actions:
1173-
- ..
1181+
- name: my_namespace
1182+
principal: principal
1183+
endpoints:
1184+
- ..
1185+
actions:
1186+
- ..
11741187
----
11751188
====
11761189

0 commit comments

Comments
 (0)