Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

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

Sign up
Appearance settings

[Security] Improve DX of recent additions#59805

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
chalasr merged 1 commit intosymfony:7.3fromnicolas-grekas:is-granted-for-user
Feb 21, 2025

Conversation

nicolas-grekas
Copy link
Member

@nicolas-grekasnicolas-grekas commentedFeb 18, 2025
edited
Loading

QA
Branch?7.3
Bug fix?no
New feature?not really
Deprecations?no
Issues-
LicenseMIT

This is a follow up of#48142 and#59150 which were merged recently into 7.3.

Summary of the changes:

  • UserAuthorizationChecker, the implementation of the corresponding interface is merged into the existingAuthorizationChecker.
  • AuthorizationChecker::isGranted() is made aware of token changed by its newisGrantedForUser() method, so that calls tois_granted() nested intois_granted_for_user() calls will check the provided user, not the logged in one.
  • Replace the many arguments passed toIsGranted's closures by 1. a newIsGrantedContext and 2. the$subject. This makes everything simpler, easier to discover, and more extensible. Thanks to the previous item, IsGrantedContext only needs the auth-checker, not the access-decision-manager anymore. Simpler again.
  • Fix to the tests, those were broken in both PRs.

javiereguiluz reacted with rocket emoji
@nicolas-grekas
Copy link
MemberAuthor

Thanks for the reviews, comments addressed.

Status: needs review

Copy link
Member

@alexandre-dauboisalexandre-daubois left a comment

Choose a reason for hiding this comment

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

Great improvement to the DX, thanks!

@nicolas-grekas
Copy link
MemberAuthor

I just removed theIsGranted::IS_* consts in favor of correspondingIsGrantedContext::is*() methods.

alexandre-daubois reacted with thumbs up emoji

@chalasr
Copy link
Member

chalasr commentedFeb 20, 2025
edited
Loading

isn't fabbot's patch legit?

@nicolas-grekas
Copy link
MemberAuthor

I think this alignment rule doesn't work when the type description is too long, so I ignored fabbot on purpose...

@chalasr
Copy link
Member

Thank you@nicolas-grekas.

@chalasrchalasr merged commit0c7c251 intosymfony:7.3Feb 21, 2025
9 of 11 checks passed
@nicolas-grekasnicolas-grekas deleted the is-granted-for-user branchFebruary 27, 2025 15:34
@fabpotfabpot mentioned this pull requestMay 2, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@javiereguiluzjaviereguiluzjaviereguiluz left review comments

@stofstofstof requested changes

@alexandre-dauboisalexandre-dauboisalexandre-daubois approved these changes

@chalasrchalasrchalasr approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
7.3
Development

Successfully merging this pull request may close these issues.

6 participants
@nicolas-grekas@chalasr@javiereguiluz@stof@alexandre-daubois@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp