Add support for "forbidden" response with missing permissions in Nginx response handler
This commit is contained in:
@@ -101,6 +101,14 @@ class response implements response_i
|
||||
$this->error('Internal server error' . ($error ? ': ' . $error : ''), 500);
|
||||
}
|
||||
|
||||
#[NoReturn] public function forbidden(array $permissions): void
|
||||
{
|
||||
$this->error([
|
||||
'message' => 'Missing permission(s)',
|
||||
'permissions' => $permissions
|
||||
], 403);
|
||||
}
|
||||
|
||||
public function paginate(int $page, int $per_page, int $total, string $search = null, array $filters = null, array $order = null): void
|
||||
{
|
||||
// If the total is 0, return 1 page, 0 total
|
||||
|
||||
Reference in New Issue
Block a user