Skip to content

Commit 290b65e

Browse files
committed
improveVoteObject
1 parent c6baf1b commit 290b65e

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public function decide(TokenInterface $token, array $attributes, mixed $object =
7272
try {
7373
return $accessDecision->isGranted = $this->strategy->decide(
7474
$this->collectResults($token, $attributes, $object, $accessDecision)
75+
, $accessDecision
7576
);
7677
} finally {
7778
array_pop($this->accessDecisionStack);

src/Symfony/Component/Security/Core/Authorization/Strategy/AccessDecisionStrategyInterface.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

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

14+
use Symfony\Component\Security\Core\Authorization\AccessDecision;
15+
1416
/**
1517
* A strategy for turning a stream of votes into a final decision.
1618
*
@@ -21,5 +23,5 @@ interface AccessDecisionStrategyInterface
2123
/**
2224
* @param \Traversable<int> $results
2325
*/
24-
public function decide(\Traversable $results): bool;
26+
public function decide(\Traversable $results, /* AccessDecision $accessDecision = null */): bool;
2527
}

src/Symfony/Component/Security/Core/Authorization/Voter/Vote.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ class Vote
2828
*/
2929
public array $reasons = [];
3030

31+
public array|object|null $extraData = null;
32+
3133
public function addReason(string $reason): void
3234
{
3335
$this->reasons[] = $reason;

src/Symfony/Component/Security/Core/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ CHANGELOG
1111
* Add ability for voters to explain their vote
1212
* Add support for voting on closures
1313
* Add `OAuth2User` with OAuth2 Access Token Introspection support for `OAuth2TokenHandler`
14+
* Add extraData in Vote object and pass it to AccessStrategy
1415

1516
7.2
1617
---

0 commit comments

Comments
 (0)
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