You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@trigger_error('The '.__NAMESPACE__.'\AbstractVoter class is deprecated since version 2.8, to be removed in 3.0. Upgrade to Symfony\Component\Security\Core\Authorization\Voter\Voter instead.', E_USER_DEPRECATED);
if (!$object || !$this->supportsClass(get_class($object))) {
66
66
returnself::ACCESS_ABSTAIN;
67
67
}
68
68
69
69
// abstain vote by default in case none of the attributes are supported
70
70
$vote = self::ACCESS_ABSTAIN;
71
71
72
72
foreach ($attributesas$attribute) {
73
-
if (!$this->supports($attribute, $object)) {
73
+
if (!$this->supportsAttribute($attribute)) {
74
74
continue;
75
75
}
76
76
77
77
// as soon as at least one attribute is supported, default is to deny access
78
78
$vote = self::ACCESS_DENIED;
79
79
80
-
if ($this->voteOnAttribute($attribute, $object, $token)) {
80
+
if ($this->isGranted($attribute, $object, $token->getUser())) {
81
81
// grant access as soon as at least one voter returns a positive response
82
82
returnself::ACCESS_GRANTED;
83
83
}
@@ -86,62 +86,19 @@ public function vote(TokenInterface $token, $object, array $attributes)
86
86
return$vote;
87
87
}
88
88
89
-
/**
90
-
* Determines if the attribute and object are supported by this voter.
91
-
*
92
-
* This method will become abstract in 3.0.
93
-
*
94
-
* @param string $attribute An attribute
95
-
* @param string $object The object to secure
96
-
*
97
-
* @return bool True if the attribute and object is supported, false otherwise
98
-
*/
99
-
protectedfunctionsupports($attribute, $object)
100
-
{
101
-
@trigger_error('The getSupportedClasses and getSupportedAttributes methods are deprecated since version 2.8 and will be removed in version 3.0. Overwrite supports instead.', E_USER_DEPRECATED);
// the user should override this method, and not rely on the deprecated isGranted()
182
-
@trigger_error(sprintf("The AbstractVoter::isGranted() method is deprecated since 2.8 and won't be called anymore in 3.0. Override voteOnAttribute() in %s instead.", get_class($this)), E_USER_DEPRECATED);
0 commit comments