Skip to content

[Security] improve VoteObject adding extraData for give more possibilities to AccessDecicsionStrategy #60085

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

Open
wants to merge 1 commit into
base: 7.4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public function decide(TokenInterface $token, array $attributes, mixed $object =
try {
return $accessDecision->isGranted = $this->strategy->decide(
$this->collectResults($token, $attributes, $object, $accessDecision)
, $accessDecision
);
} finally {
array_pop($this->accessDecisionStack);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

namespace Symfony\Component\Security\Core\Authorization\Strategy;

use Symfony\Component\Security\Core\Authorization\AccessDecision;

/**
* A strategy for turning a stream of votes into a final decision.
*
Expand All @@ -21,5 +23,5 @@ interface AccessDecisionStrategyInterface
/**
* @param \Traversable<int> $results
*/
public function decide(\Traversable $results): bool;
public function decide(\Traversable $results, /* AccessDecision $accessDecision = null */): bool;
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class Vote
*/
public array $reasons = [];

public array|object|null $extraData = null;

public function addReason(string $reason): void
{
$this->reasons[] = $reason;
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/Security/Core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ CHANGELOG
* Add ability for voters to explain their vote
* Add support for voting on closures
* Add `OAuth2User` with OAuth2 Access Token Introspection support for `OAuth2TokenHandler`
* Add extraData in Vote object and pass it to AccessStrategy

7.2
---
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy