Skip to content

Commit 65741ea

Browse files
SimperfitAmrouche Hamza
authored andcommitted
fix from review
1 parent 4141af3 commit 65741ea

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

core/security.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,18 @@ section.
66
Using API Platform, you can leverage all security features provided by the [Symfony Security component](http://symfony.com/doc/current/book/security.html).
77
For instance, if you wish to restrict the access of some endpoints, you can use [access controls directives](http://symfony.com/doc/current/book/security.html#securing-url-patterns-access-control).
88

9-
You can also add security directly in the entity using the [Symfony's access control expressions](https://symfony.com/doc/current/expressions.html#security-complex-access-controls-with-expressions).
10-
Here is a little exemple for this :
9+
Since 2.1, you can add security through [Symfony's access control expressions](https://symfony.com/doc/current/expressions.html#security-complex-access-controls-with-expressions) in your entities.
1110

12-
```php
11+
Here is an example:
1312

13+
```php
1414
use ApiPlatform\Core\Annotation\ApiResource;
1515
use Doctrine\ORM\Mapping as ORM;
1616
use Symfony\Component\Validator\Constraints as Assert;
1717

1818
/**
1919
* Secured resource.
2020
*
21-
* @author Kévin Dunglas <dunglas@gmail.com>
22-
*
2321
* @ApiResource(
2422
* attributes={"is_granted"="has_role('ROLE_USER')"},
2523
* collectionOperations={
@@ -42,6 +40,7 @@ class Book
4240
* @ORM\GeneratedValue(strategy="AUTO")
4341
*/
4442
public $id;
43+
4544
/**
4645
* @var string The title
4746
*

0 commit comments

Comments
 (0)