diff options
Diffstat (limited to 'Http/Firewall')
-rw-r--r-- | Http/Firewall/AccessListener.php | 6 | ||||
-rw-r--r-- | Http/Firewall/SwitchUserListener.php | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/Http/Firewall/AccessListener.php b/Http/Firewall/AccessListener.php index c234317..75798b9 100644 --- a/Http/Firewall/AccessListener.php +++ b/Http/Firewall/AccessListener.php @@ -67,7 +67,11 @@ class AccessListener implements ListenerInterface } if (!$this->accessDecisionManager->decide($token, $attributes, $request)) { - throw new AccessDeniedException(); + $exception = new AccessDeniedException(); + $exception->setAttributes($attributes); + $exception->setSubject($request); + + throw $exception; } } } diff --git a/Http/Firewall/SwitchUserListener.php b/Http/Firewall/SwitchUserListener.php index 7de83d2..e9c3e40 100644 --- a/Http/Firewall/SwitchUserListener.php +++ b/Http/Firewall/SwitchUserListener.php @@ -122,7 +122,10 @@ class SwitchUserListener implements ListenerInterface } if (false === $this->accessDecisionManager->decide($token, array($this->role))) { - throw new AccessDeniedException(); + $exception = new AccessDeniedException(); + $exception->setAttributes($this->role); + + throw $exception; } $username = $request->get($this->usernameParameter); |