Правила доступа на запись и подписанные ссылки
This commit is contained in:
1 parent
9508c29964
commit
3a04ee5bb3
14 files changed
+638
-10
No files matched your search
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rsgrinko\Proton\Access;
|
||||
|
||||
use Rsgrinko\Proton\Support\ProtonException;
|
||||
|
||||
/**
|
||||
* Правило на запись не пустило. Ядро превращает это в 403: страницу для
|
||||
* браузера, JSON для API.
|
||||
*
|
||||
* Отдельное исключение, а не возврат Response из контроллера: проверку ставят
|
||||
* первой строкой действия, и она должна прерывать работу, а не требовать
|
||||
* помнить про return.
|
||||
*/
|
||||
final class AccessDenied extends ProtonException
|
||||
{
|
||||
/**
|
||||
* @param array<string, mixed> $context
|
||||
*/
|
||||
public function __construct(string $message = 'Нет доступа', array $context = [])
|
||||
{
|
||||
parent::__construct($message, $context, 403);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user