8000 AccessDeniedException: rename object to subject · symfony/symfony@9603ffa · GitHub
[go: up one dir, main page]

Skip to content

Commit 9603ffa

Browse files
committed
AccessDeniedException: rename object to subject
With this change the name is inline with what we use in the base voter interface.
1 parent a86583d commit 9603ffa

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ protected function denyAccessUnlessGranted($attributes, $object = null, $message
194194
if (!$this->isGranted($attributes, $object)) {
195195
$exception = $this->createAccessDeniedException($message);
196196
$exception->setAttributes($attributes);
197-
$exception->setObject($object);
197+
$exception->setSubject($object);
198198

199199
throw $exception;
200200
}

src/Symfony/Component/Security/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CHANGELOG
44
3.2.0
55
-----
66

7-
* added `attributes` and `object` with getters/setters to `Symfony\Component\Security\Core\Exception\AccessDeniedException`
7+
* added `$attributes` and `$subject` with getters/setters to `Symfony\Component\Security\Core\Exception\AccessDeniedException`
88

99
3.0.0
1010
-----

src/Symfony/Component/Security/Core/Exception/AccessDeniedException.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
class AccessDeniedException extends \RuntimeException
2020
{
2121
private $attributes = array();
22-
private $object;
22+
private $subject;
2323

2424
public function __construct($message = 'Access Denied.', \Exception $previous = null)
2525
{
@@ -45,16 +45,16 @@ public function setAttributes($attributes)
4545
/**
4646
* @return mixed
4747
*/
48-
public function getObject()
48+
public function getSubject()
4949
{
50-
return $this->object;
50+
return $this->subject;
5151
}
5252

5353
/**
54-
* @param mixed $object
54+
* @param mixed $subject
5555
*/
56-
public function setObject($object)
56+
public function setSubject($subject)
5757
{
58-
$this->object = $object;
58+
$this->subject = $subject;
5959
}
6060
}

src/Symfony/Component/Security/Http/Firewall/AccessListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function handle(GetResponseEvent $event)
6969
if (!$this->accessDecisionManager->decide($token, $attributes, $request)) {
7070
$exception = new AccessDeniedException();
7171
$exception->setAttributes($attributes);
72-
$exception->setObject($request);
72+
$exception->setSubject($request);
7373

7474
throw $exception;
7575
}

0 commit comments

Comments
 (0)
0