Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[SecurityBundle][TwigBridge] Add is_granted_for_user() function #59129

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
Dec 22, 2024

Conversation

natewiebe13
Copy link
Contributor

Q A
Branch? 7.3
Bug fix? no
New feature? yes
Deprecations? no
Issues N/A
License MIT

Twig function to accompany #48142

@natewiebe13
Copy link
Contributor Author

@derrabus hoping this can get released along with #48142 for 7.3 :)

I'll have PRs for docs ready early next week.

@OskarStark OskarStark changed the title Add user_is_granted() function to twig Add user_is_granted() function to twig Dec 7, 2024
@carsonbot carsonbot changed the title Add user_is_granted() function to twig [SecurityBundle][TwigBridge] Add user_is_granted() function to twig Dec 7, 2024
@OskarStark OskarStark changed the title [SecurityBundle][TwigBridge] Add user_is_granted() function to twig [SecurityBundle][TwigBridge] Add user_is_granted() function Dec 7, 2024
@OskarStark
Copy link
Contributor

We also need no raise the dependency to 7.3 in composer.json to make it work

@derrabus
Copy link
Member

derrabus commented Dec 7, 2024

We also need no raise the dependency to 7.3 in composer.json to make it work

We should not need to do that. The dependency is optional. 🤔

@OskarStark
Copy link
Contributor

OskarStark commented Dec 7, 2024

We also need no raise the dependency to 7.3 in composer.json to make it work

We should not need to do that. The dependency is optional. 🤔

Ok

@natewiebe13
Copy link
Contributor Author

Fixed BC break.

@natewiebe13 natewiebe13 changed the title [SecurityBundle][TwigBridge] Add user_is_granted() function [SecurityBundle][TwigBridge] Add is_granted_for_user() function Dec 17, 2024
@stof
Copy link
Member

stof commented Dec 17, 2024

I'm still holding on my comment in #59129 (comment)
I don't think return false for all calls to is_granted_for_user is the expected behavior if you configure the extension without a UserAuthorizationChecker.

@chalasr
Copy link
Member

chalasr commented Dec 17, 2024

Better DX is desirable here so 👍 for stof's suggestion. It should be a \LogicException

@natewiebe13
Copy link
Contributor Author

Sounds good. Just wanted to make sure there was consensus on that. 👍

@chalasr
Copy link
Member

chalasr commented Dec 22, 2024

Thank you @natewiebe13.

@chalasr chalasr merged commit 78f4d9a into symfony:7.3 Dec 22, 2024
10 of 11 checks passed
@natewiebe13 natewiebe13 deleted the twig-user-is-granted branch January 2, 2025 15:21
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Jan 3, 2025
… (Nate Wiebe)

This PR was merged into the 7.3 branch.

Discussion
----------

[Security] Add docs for `is_granted_for_user()` function

Fixes #20489

Adds docs for new twig function:
* symfony/symfony#59129

Commits
-------

e1c23c7 Add docs for is_granted_for_user() function
@fabpot fabpot mentioned this pull request May 2, 2025
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.

10 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.