Skip to content

Commit 75990b7

Browse files
Maximilian Zumbansennicolas-grekas
authored andcommitted
[Security] Add argument $exceptionCode to #[IsGranted]
1 parent e2eff18 commit 75990b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Exception/AccessDeniedException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ class AccessDeniedException extends RuntimeException
2424
private array $attributes = [];
2525
private mixed $subject = null;
2626

27-
public function __construct(string $message = 'Access Denied.', \Throwable $previous = null)
27+
public function __construct(string $message = 'Access Denied.', \Throwable $previous = null, int $code = 403)
2828
{
29-
parent::__construct($message, 403, $previous);
29+
parent::__construct($message, $code, $previous);
3030
}
3131

3232
public function getAttributes(): array

0 commit comments

Comments
 (0)