Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup security voters cookbook recipes #5453

Merged
merged 3 commits into from
Jul 16, 2015
Merged

Conversation

wouterj
Copy link
Member

@wouterj wouterj commented Jun 27, 2015

Q A
Doc fix? yes
New docs? no
Applies to all
Fixed tickets #5084

Blacklisting using voters isn't a good practice and in fact, the article (cookbook/security/voters) was almost completely equal to the much newer voter article (cookbook/security/voters_data_permission). I've moved the only different piece (access decision strategy) to the newer voter article and then removed the old voter article.

As the old voter article had a much nicer URL than the new one, I then renamed the new article to have the better name and set up a redirection. A quick search on Google revealed that there are almost no links to the old article talking about blacklisting specifically, just about voters. So I think we're good here.

The diff is horrible, that's why I've tried to create multiple commits (this will ease reviewing process). The only commit requiring review is 9c169c7 (as the other 2 are just moving and removing stuff).

@wouterj wouterj force-pushed the issue_5084 branch 2 times, most recently from 0c9c0f9 to d6fb58a Compare June 27, 2015 19:55
@@ -14,7 +14,7 @@ the ACL system comes in.
Using ACL's isn't trivial, and for simpler use cases, it may be overkill.
If your permission logic could be described by just writing some code (e.g.
to check if a Blog is owned by the current User), then consider using
:doc:`voters </cookbook/security/voters_data_permission>`. A voter is passed the object
:doc:`voters </cookbook/security/voters`. A voter is passed the object
Copy link
Member

Choose a reason for hiding this comment

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

missing closing angle bracket

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

use business logic (e.g. the user can edit this post because they were
the creator) to determine access. You'll probably want this option - it's
flexible enough to solve the above situation.
* :doc:`Voters </cookbook/security/voters>` allow you to use business logic
Copy link
Member

Choose a reason for hiding this comment

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

[...] to use business logic [...] looks very generic to me. I'd like something like: ... apply your own business logic ..., ... define the custom logic applied to ..., etc.

Choose a reason for hiding this comment

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

👍

@weaverryan weaverryan merged commit 93484a7 into symfony:2.3 Jul 16, 2015
weaverryan added a commit that referenced this pull request Jul 16, 2015
This PR was merged into the 2.3 branch.

Discussion
----------

Cleanup security voters cookbook recipes

| Q | A
| --- | ---
| Doc fix? | yes
| New docs? | no
| Applies to | all
| Fixed tickets | #5084

Blacklisting using voters isn't a good practice and in fact, the article (`cookbook/security/voters`) was almost completely equal to the much newer voter article (`cookbook/security/voters_data_permission`). I've moved the only different piece (access decision strategy) to the newer voter article and then removed the old voter article.

As the old voter article had a much nicer URL than the new one, I then renamed the new article to have the better name and set up a redirection. A [quick search on Google](https://www.google.nl/search?q=%5Blink%3Ahttp%3A%2F%2Fsymfony.com%2Fdoc%2Fcurrent%2Fcookbook%2Fsecurity%2Fvoters.html%5D+-site%3Ahttp%3A%2F%2Fsymfony.com) revealed that there are almost no links to the old article talking about blacklisting specifically, just about voters. So I think we're good here.

The diff is horrible, that's why I've tried to create multiple commits (this will ease reviewing process). The only commit requiring review is 9c169c7 (as the other 2 are just moving and removing stuff).

Commits
-------

93484a7 Remove the old voter article
9c169c7 Rewrite new section
acf66f9 Move access decision strategy section
@weaverryan
Copy link
Member

@wouterj Really good idea moving things around, etc - I like it a lot. I've merged this in and all the way up with minor tweaks at sha: d4afd3a thanks to some suggestions.

Thanks!

weaverryan added a commit that referenced this pull request Jul 16, 2015
* 2.3:
  [#5453] Minor tweaks - mostly thanks to Javier
weaverryan added a commit that referenced this pull request Jul 16, 2015
* 2.6:
  [#5472] Minor tweak and adding code example
  [#5453] Minor tweaks - mostly thanks to Javier
  Reword
  Fix caching
  Fix build
  Added a tip about hashing the result of nextBytes()
  rework the quick tour's big picture
  fix for Symfony 2.7
  Fix after install URL and new photo since AcmeDemoBundle is not part of 2.7
  Improve travis build speed
weaverryan added a commit that referenced this pull request Jul 16, 2015
* 2.7:
  [#5472] Minor tweak and adding code example
  [#5453] Minor tweaks - mostly thanks to Javier
  Reword
  Fix caching
  Fix build
  Added a tip about hashing the result of nextBytes()
  rework the quick tour's big picture
  fix for Symfony 2.7
  Fix after install URL and new photo since AcmeDemoBundle is not part of 2.7
  Improve travis build speed
weaverryan added a commit that referenced this pull request Jul 16, 2015
* 2.8:
  [#5472] Minor tweak and adding code example
  [#5453] Minor tweaks - mostly thanks to Javier
  Reword
  Fix moving the mapped down as per @xabbuh
  Fix caching
  Fix build
  Fix the rendering issue
  Fix issues reported by @snoek09 . Thank you.
  Added a tip about hashing the result of nextBytes()
  Make the necessary changes mentioned by @xabbuh and add example for form
  rework the quick tour's big picture
  fix for Symfony 2.7
  Fix after install URL and new photo since AcmeDemoBundle is not part of 2.7
  Starting with range documentation
  Improve travis build speed
@wouterj wouterj deleted the issue_5084 branch July 16, 2015 07:47
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.

5 participants