Skip to content

Commit 0abf218

Browse files
committed
Merge branch '3.4' into 4.4
* 3.4: Adding `path` Fix term Change char to varchar type Use redirectToRoute [#13980] add annotation config example [Validator] Made the code sample more explicit with accepted values Update voters.rst Update voters.rst Update voters.rst Update security/voters.rst Update voters.rst [#13554] Slightly reworded the tip Update voters.rst Explaining controllers as viable alternative
2 parents 3b0c9b7 + 15330f4 commit 0abf218

File tree

6 files changed

+29
-10
lines changed

6 files changed

+29
-10
lines changed

components/http_foundation.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ or change its ``Content-Disposition``::
621621
'filename.txt'
622622
);
623623

624-
It is possible to delete the file after the request is sent with the
624+
It is possible to delete the file after the response is sent with the
625625
:method:`Symfony\\Component\\HttpFoundation\\BinaryFileResponse::deleteFileAfterSend` method.
626626
Please note that this will not work when the ``X-Sendfile`` header is set.
627627

controller/upload_file.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ Finally, you need to update the code of the controller that handles the form::
170170

171171
// ... persist the $product variable or any other work
172172

173-
return $this->redirect($this->generateUrl('app_product_list'));
173+
return $this->redirectToRoute('app_product_list');
174174
}
175175

176176
return $this->render('product/new.html.twig', [

reference/configuration/security.rst

+8
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,14 @@ The user is considered to have changed when the user class implements
577577
required by the :class:`Symfony\\Component\\Security\\Core\\User\\UserInterface`
578578
(like the username, password or salt) changes.
579579

580+
``path``
581+
~~~~~~~~
582+
583+
**type**: ``string`` **default**: ``/logout``
584+
585+
The path which triggers logout. If you change it from the default value ``/logout``,
586+
you need to set up a route with a matching path.
587+
580588
success_handler
581589
~~~~~~~~~~~~~~~
582590

reference/constraints/Collection.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ you can do the following:
209209
* }
210210
* )
211211
*/
212-
protected $profileData = ['personal_email'];
212+
protected $profileData = ['personal_email' => '[email protected]'];
213213
}
214214
215215
.. code-block:: yaml

security/remember_me.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ so ``DoctrineTokenProvider`` can store the tokens:
241241
242242
CREATE TABLE `rememberme_token` (
243243
`series` char(88) UNIQUE PRIMARY KEY NOT NULL,
244-
`value` char(88) NOT NULL,
244+
`value` varchar(88) NOT NULL,
245245
`lastUsed` datetime NOT NULL,
246246
`class` varchar(100) NOT NULL,
247247
`username` varchar(200) NOT NULL

security/voters.rst

+17-6
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,30 @@
66
How to Use Voters to Check User Permissions
77
===========================================
88

9-
Security voters are the most granular way of checking permissions (e.g. "can this
10-
specific user edit the given item?"). This article explains voters in detail.
9+
Voters are Symfony's most powerful way of managing permissions. They allow you
10+
to centralize all permission logic, then reuse them in many places.
11+
12+
However, if you don't reuse permissions or your rules are basic, you can always
13+
put that logic directly into your controller instead. Here's an example how
14+
this could look like, if you want to make a route accessible to the "owner" only::
15+
16+
// src/AppBundle/Controller/PostController.php
17+
// ...
18+
19+
if ($post->getOwner() !== $this->getUser()) {
20+
throw $this->createAccessDeniedException();
21+
}
22+
23+
In that sense, the following example used throughout this page is a minimal
24+
example for voters.
1125

1226
.. tip::
1327

1428
Take a look at the
1529
:doc:`authorization </components/security/authorization>`
1630
article for an even deeper understanding on voters.
1731

18-
How Symfony Uses Voters
19-
-----------------------
20-
21-
In order to use voters, you have to understand how Symfony works with them.
32+
Here's how Symfony works with voters:
2233
All voters are called each time you use the ``isGranted()`` method on Symfony's
2334
authorization checker or call ``denyAccessUnlessGranted()`` in a controller (which
2435
uses the authorization checker), or by

0 commit comments

Comments
 (0)