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] AccessDecisionManager refactoring#942

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

Closed
hhamon wants to merge3 commits intosymfony:masterfromhhamon:security_strategy

Conversation

@hhamon
Copy link
Contributor

Hi Fabien, hi Johannes,

I've tried to refactor the AccessDecisionManager class in the security component. I split the three access decision strategies (affirmative, consensus and unanimous) into three dedicated classes. Each strategy class implements the AccessStrategyInterface interface to enforce they have the same public API.

With this changeset, it's now easier to add new access decision strategies into the AccessDecisionManager object.

I couldn't manage to check if any regression came up because I have the following exception:

You cannot create a service ("request") of an inactive scope ("request").

I'm not sure this exception is due to my changeset. Could you please test this pull request or help me to find and understand why I have this exception.

Thanks.

Hugo.

@schmittjoh
Copy link
Contributor

There is already one interfaceAccessDecisionManagerInterface. I don't see the value in adding another one.

We could still split the strategies in different classes using inheritance instead of composition; something like this:

AffirmativeAccessDecisionManager extendsVotingBasedAccessDecisionManager
UnanimousAccessDecisionManager extendsVotingBasedAccessDecisionManager
etc.

@hhamon
Copy link
ContributorAuthor

That seems a good idea too!

@fabpot
Copy link
Member

Closing this PR... and waiting for another one based on Johannes idea.

@fabpotfabpot closed thisMay 14, 2011
@hhamon
Copy link
ContributorAuthor

I'm working on it ;)

nicolas-grekas added a commit that referenced this pull requestJul 12, 2017
…ss decision manager service (xabbuh)This PR was merged into the 3.4 branch.Discussion----------[Security] make it possible to configure a custom access decision manager service| Q | A || --- | --- || Branch? | 3.4 || Bug fix? | no || New feature? | yes || BC breaks? | no || Deprecations? | no || Tests pass? | yes || Fixed tickets |#942,#14049,#15295,#16828,#16843, || License | MIT || Doc PR | TODO |These changes will make it possible to let users define their own voting strategies without the need for custom compiler passes that replace the built-in `AccessDecisionManager` (see linked issues in the PR table for some use cases).Commits-------e0913a2 add option to define the access decision manager
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@hhamon@schmittjoh@fabpot

[8]ページ先頭

©2009-2025 Movatter.jp