Skip to content

Commit e23acfb

Browse files
committed
Align ACL README with Behavior
1 parent 62940fe commit e23acfb

File tree

1 file changed

+30
-59
lines changed

1 file changed

+30
-59
lines changed
Lines changed: 30 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,45 @@
1-
= Spring Data AOT Sample
1+
= Spring Data Sample
22

3-
To compile this project, you will need to use a special Java compiler.
4-
If you are using SDKMan!, then the version will be correctly selected for you.
5-
Or, you can do the following:
3+
After running this sample like so:
64

7-
```bash
8-
sdk use java 23.0.5.r17-nik
9-
```
10-
11-
After that, you can compile like so:
12-
13-
```bash
14-
./gradlew nativeCompile
15-
```
16-
17-
Once compiled, you can run like so:
18-
19-
```bash
20-
./build/native/nativeCompile/data
21-
```
5+
.Java
6+
[source,java,role="primary"]
7+
----
8+
./gradlew :bootRun
9+
----
2210

2311
Then you can query for messages using `luke/password` and `rob/password`.
2412

25-
Because the domain objects are secured, you will see a subset of fields with `luke`.
13+
Because the domain objects are secured by ACLs, Rob will only see Rob's messages, and Luke will only see Luke's.
2614

2715
For example, querying `/` with `luke`, you'll see:
2816

29-
```json
30-
...
17+
[source,json]
18+
----
19+
[
3120
{
32-
"created": "2014-07-12T16:00:00Z",
33-
"id": 112,
34-
"summary": "Is this secure?",
21+
"created": "2014-07-12T10:00:00Z",
22+
"id": 110,
23+
"summary": "Hello Luke",
3524
"text": "This message is for Luke",
36-
"to": {
37-
"email": "luke@example.com",
38-
"id": "luke",
39-
"password": "password"
40-
}
41-
}
42-
...
43-
```
44-
45-
However, with `rob`, you'll also see `firstName` and `lastName` like so:
46-
47-
```json
48-
...
25+
"to": "luke"
26+
},
27+
{
28+
"created": "2014-07-12T10:00:00Z",
29+
"id": 111,
30+
"summary": "Greetings Luke",
31+
"text": "This message is for Luke",
32+
"to": "luke"
33+
},
4934
{
50-
"created": "2014-07-12T04:00:00Z",
51-
"id": 102,
35+
"created": "2014-07-12T10:00:00Z",
36+
"id": 112,
5237
"summary": "Is this secure?",
53-
"text": "This message is for Rob",
54-
"to": {
55-
"email": "rob@example.com",
56-
"firstName": "Rob",
57-
"id": "rob",
58-
"lastName": "Winch",
59-
"password": "password"
60-
}
38+
"text": "This message is for Luke",
39+
"to": "luke"
6140
}
62-
...
63-
```
64-
65-
You can also change the message text.
66-
To do this, copy and paste the `X-CSRF-TOKEN` and `Cookie: JSESSION` headers and include them in a `PUT :8080/102` request.
67-
68-
An example of this request using HTTPie can be seen below:
41+
]
42+
----
6943

70-
```bash
71-
echo -n "updated message" | http -a rob:password PUT :8080/102 "X-CSRF-TOKEN: {copied from GET request}" "Cookie: JSESSIONID={copied from GET request}"
72-
```
7344

74-
Read more about the https://docs.spring.io/spring-security/reference/servlet/authorization/method-security.html#authorize-object[`@AuthorizeReturnObject`] and https://docs.spring.io/spring-security/reference/servlet/authorization/method-security.html#fallback-values-authorization-denied[]`@DeniedHandler`] in the Spring Security Reference.
45+
Read more about https://docs.spring.io/spring-security/reference/servlet/authorization/acls.html[Authorization by ACL] in the Spring Security Reference.

0 commit comments

Comments
 (0)