Skip to content

Commit 5afec80

Browse files
jewome62dunglas
authored andcommitted
Update security doc (#624)
* Update security doc Add sentence to redirect to extension to restrict a collection * Update security.md
1 parent 7f8f92f commit 5afec80

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/security.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,8 @@ App\Entity\Book:
120120
access_control_message: 'Sorry, but you are not the book owner.'
121121
# ...
122122
```
123+
124+
In access control expressions for collection, the `object` variable contains the list of resources that will be serialized.
125+
To remove entries from a collection, you should implement [a Doctrine extension](extensions.md) to customize the generated DQL query (e.g. add `WHERE` clauses depending of the currently connected user) instead of using access control expressions.
126+
127+
If you use [custom data providers](data-providers.md), you'll have to implement the filtering logic accordingly to the persistence layer you rely on.

0 commit comments

Comments
 (0)