You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* "get"={"method"="GET", "is_granted"="has_role('ROLE_USER') and object.getOwner() == user"}
28
+
* "get"={"method"="GET", "access_control"="has_role('ROLE_USER') and object.getOwner() == user"}
29
29
* }
30
30
* )
31
31
* @ORM\Entity
@@ -51,6 +51,8 @@ class Book
51
51
}
52
52
```
53
53
54
+
This exemple is going to allow only fetching the book related to the current user, if he try to fetch a book that is not linked to his account that will not return the resource and only admins are able to create books which means that a user could not create a book.
55
+
54
56
It is also possible to use the [event system](events.md) for more advanced logic or even [custom actions](operations.md#creating-custom-operations-and-controllers)
0 commit comments