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

[SecurityBundle] Configure Voter priority via getDefaultPriority #46563

Open
wants to merge 1 commit into
base: 7.2
Choose a base branch
from

Conversation

paradajozsef
Copy link
Contributor

Q A
Branch? 6.2
Bug fix? no
New feature? yes
Deprecations? no
Tickets Fix #43074
License MIT
Doc PR Will do if PR gets approval

The issue describes well the missing feature. Solution is based on #43074 (comment) As mentioned in #43074 (comment) it can be solved with PHP attributes already. If this became obsolete, feel free to close it.

@carsonbot
Copy link

Hey!

I think @NicoHaase has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

@nicolas-grekas
Copy link
Member

We can also use #[Autoconfigure(tags: [['security.voter' => ['priority' => 3000]]])] but what about adding a #[AsVoter(priority: 3000)] attribute to make it easier ?

I like this proposal about #[AsVoter] actually. Would you be up to give it a try?
I feel like we could even deprecate these static methods in favor of attributes now.

@nicolas-grekas
Copy link
Member

Oh, reading the source, I figured out we already have an attribute for that: #[AsTaggedItem(priority: 100)] would work equally well.
Can you update the PR and its test cases to use+mention this attribute instead of getDefaultPriority()? I'm going to suggest deprecating this method in a follow up PR.

@nicolas-grekas
Copy link
Member

Friendly ping @paradajozsef

@nicolas-grekas nicolas-grekas modified the milestones: 6.2, 6.3 Nov 5, 2022
@nicolas-grekas nicolas-grekas modified the milestones: 6.3, 6.4 May 23, 2023
@nicolas-grekas nicolas-grekas modified the milestones: 6.4, 7.1 Nov 15, 2023
@xabbuh xabbuh modified the milestones: 7.1, 7.2 May 15, 2024
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.

getDefaultPriority behavior not working with voter
4 participants