Skip to content

Conversation

dmerchier
Copy link
Contributor

As asked in issue #792, I replaced some @Security("is_granted()") annotations by @IsGranted.

*/
public function edit(Request $request, Post $post): Response
{
$this->denyAccessUnlessGranted('edit', $post, 'Posts can only be edited by their authors.');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to keep this as another way of doing the same but without the annotation one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I let an example in the show action (see the code)

@javiereguiluz
Copy link
Member

Thanks @DevMDamien for this contribution! And congrats on your first contribution to the Symfony project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants