* Check user permissions on the routes #508 * Formatting
This commit is contained in:
@@ -168,8 +168,33 @@ return [
|
||||
'middleware' => [
|
||||
'register' => true,
|
||||
'handling' => 'redirect',
|
||||
'params' => '/login',
|
||||
|
||||
/**
|
||||
* Handlers for the unauthorized method in the middlewares.
|
||||
* The name of the handler must be the same as the handling.
|
||||
*/
|
||||
'handlers' => [
|
||||
/**
|
||||
* Aborts the execution with a 403 code and allows you to provide the response text
|
||||
*/
|
||||
'abort' => [
|
||||
'code' => 403,
|
||||
'message' => 'User does not have any of the necessary access rights.',
|
||||
],
|
||||
/**
|
||||
* Redirects the user to the given url.
|
||||
* If you want to flash a key to the session,
|
||||
* you can do it by setting the key and the content of the message
|
||||
* If the message content is empty it won't be added to the redirection.
|
||||
*/
|
||||
'redirect' => [
|
||||
'url' => '/',
|
||||
'message' => [
|
||||
'key' => 'flash_notification.message',
|
||||
'content' => 'User does not have any of the necessary access rights.',
|
||||
],
|
||||
],
|
||||
],
|
||||
'params' => '/login',
|
||||
],
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user