Middlewares
Definition
A middleware provide a convenient mechanism for filtering HTTP requests entering your application.
You can have more information about middleware in the Laravel official documentation.
CheckPermissions
This middleware checks if the user has the permission to access a route. It checks :
If the visiting module is active on the current domain
If the user has at least one role that gives him access to the module
If the user has the requested capacity or if he's admin
Use uccello.permissions:capbilityName
to call this middleware.
Default capabilities
Name
Description
retrieve
Allows to access to the List View and the Detail View.
create
Allows to access to the Edit View for creating a new record.
update
Allows to access to the Edit View for updating an existing record.
delete
Allows to delete a record.
admin
Allows to manage a module. If the user has can edit profiles, the admin capability allows him to give access to the related module.
API capabilities
These capabilities are part of the uccello/uccello-api package but are managed natively by Uccello.
Name
Description
api-retrieve
Allows to list records and the the detail of a record with the API.
api-create
Allows to create a new record with the API.
api-update
Allows to update an existing record with the API.
api-delete
Allows to delete a record with the API.
CheckSettingsPanel
This middleware checks if the user can access to the Settings Panel. An user can access to it if at least one of these conditions is true:
The user is admin:
$user->is_admin === true
The user can admin at least one admin module.
Use uccello.settings
to call this middleware.
Last updated
Was this helpful?