10000 [Security] Changed has_role to is_granted for expression in upgrade 4.4 by linaori · Pull Request #34593 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Security] Changed has_role to is_granted for expression in upgrade 4.4 #34593

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

Merged
merged 1 commit into from
Nov 26, 2019

Conversation

linaori
Copy link
Contributor
@linaori linaori commented Nov 25, 2019
Q A
Branch? 4.4
Bug fix? no
New feature? no
Deprecations? no
Tickets ~
License MIT
Doc PR ~

A user on slack was looking for a replacement for the [ROLE1, ROLE2] notation on $this->denyAccessUnlessGranted. After searching for has_role, they pointed out that the function has been deprecated as well: https://github.com/symfony/security/blob/297ac031eeae519c87b400ff6ed7fc1819e64d73/Core/Authorization/ExpressionLanguageProvider.php#L57-L65

This PR fixes the upgrade guide to point to the non-deprecated alternative.

Additionally it turns out that the removal of has_role() has not been documented in UPGRADE-5.0.md

remake of #34592, there will be another PR for security/CHANGELOG.md in 5.0

@yceruto yceruto changed the title [Security] Changed has_user to is_granted for expression in upgrade 4.4 [Security] Changed has_role to is_granted for expression in upgrade 4.4 Nov 25, 2019
@fabpot
Copy link
Member
fabpot commented Nov 26, 2019

Thank you @linaori.

fabpot added a commit that referenced this pull request Nov 26, 2019
… in upgrade 4.4 (linaori)

This PR was merged into the 4.4 branch.

Discussion
----------

[Security] Changed has_role to is_granted for expression in upgrade 4.4

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | ~ <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | ~ <!-- required for new features -->

A user on slack was looking for a replacement for the `[ROLE1, ROLE2]` notation on `$this->denyAccessUnlessGranted`. After searching for `has_role`, they pointed out that the function has been deprecated as well: https://github.com/symfony/security/blob/297ac031eeae519c87b400ff6ed7fc1819e64d73/Core/Authorization/ExpressionLanguageProvider.php#L57-L65

This PR fixes the upgrade guide to point to the non-deprecated alternative.

Additionally it turns out that the removal of `has_role()` has not been documented in `UPGRADE-5.0.md`

_remake of #34592, there will be another PR for security/CHANGELOG.md in 5.0_

Commits
-------

78ff806 has_roles should be is_granted in upgrade files
@fabpot fabpot merged commit 78ff806 into symfony:4.4 Nov 26, 2019
fabpot added a commit that referenced this pull request Nov 26, 2019
… in upgrade 5.0 (linaori)

This PR was merged into the 5.0 branch.

Discussion
----------

[Security] Changed has_role to is_granted for expression in upgrade 5.0

| Q             | A
| ------------- | ---
| Branch?       | 5.0
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | ~ <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | ~ <!-- required for new features -->

Changes for #34593 that can only be applied on 5.0+

Commits
-------

2f1336e has_roles should be is_granted in security upgrade file
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.

6 participants
0