Skip to content

Commit b97ef81

Browse files
committed
[Workflow] Added inheritance to 'GuardListener'
1 parent b72fc53 commit b97ef81

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

src/Symfony/Component/Workflow/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ CHANGELOG
88
* Added support for `Event::getWorkflowName()` for "announce" events.
99
* Added `workflow.completed` events which are fired after a transition is completed.
1010
* Added `guard_listener` configuration option along with `workflow.guard_listener` parameter.
11+
* Added inheritance to `GuardListener`.
1112

1213
3.3.0
1314
-----

src/Symfony/Component/Workflow/EventListener/GuardListener.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424
*/
2525
class GuardListener
2626
{
27-
private $configuration;
28-
private $expressionLanguage;
29-
private $tokenStorage;
30-
private $authorizationChecker;
31-
private $trustResolver;
32-
private $roleHierarchy;
33-
private $validator;
27+
protected $configuration;
28+
protected $expressionLanguage;
29+
protected $tokenStorage;
30+
protected $authorizationChecker;
31+
protected $trustResolver;
32+
protected $roleHierarchy;
33+
protected $validator;
3434

3535
public function __construct(array $configuration, ExpressionLanguage $expressionLanguage, TokenStorageInterface $tokenStorage, AuthorizationCheckerInterface $authorizationChecker, AuthenticationTrustResolverInterface $trustResolver, RoleHierarchyInterface $roleHierarchy = null, ValidatorInterface $validator = null)
3636
{
@@ -62,15 +62,15 @@ public function onTransition(GuardEvent $event, $eventName)
6262
}
6363
}
6464

65-
private function validateGuardExpression(GuardEvent $event, $expression)
65+
protected function validateGuardExpression(GuardEvent $event, $expression)
6666
{
6767
if (!$this->expressionLanguage->evaluate($expression, $this->getVariables($event))) {
6868
$event->setBlocked(true);
6969
}
7070
}
7171

7272
// code should be sync with Symfony\Component\Security\Core\Authorization\Voter\ExpressionVoter
73-
private function getVariables(GuardEvent $event)
73+
protected function getVariables(GuardEvent $event)
7474
{
7575
$token = $this->tokenStorage->getToken();
7676

0 commit comments

Comments
 (0)