Skip to content

Navigation Menu

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

Appearance settings

Commit 8f4be1b

Browse filesBrowse files
committed
improveVoteObject
1 parent 58a14ab commit 8f4be1b
Copy full SHA for 8f4be1b

File tree

4 files changed

+7
-1
lines changed
Filter options

4 files changed

+7
-1
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php
+1Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authorization/Strategy/AccessDecisionStrategyInterface.php
+3-1Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authorization/Voter/Vote.php
+2Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/CHANGELOG.md
+1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.