Authentication contract changes
The interface itself has changed namespace:
check() method has changed signature.
Previous behaviour: it returned
false if no user logged in, or the logged in user, if logged in.
New behaviour: it returns
false if not logged in,
true if logged in.
To get the current logged in user, there's a new method added:
Acessing the currently logged in user
The currently logged in user is now loaded on every view by default.
You can access the currently logged in user with the
New permissions middleware
Before in AsgardCMS v1 permissions where checked by reading the current URI and matching that with the keys in the
permissions.php config file of every module.
This worked but wasn't very flexible and thus been removed on AsgardCMS v2.
There is a new
Authorization middleware class which can be used as displayed:
'as' => 'admin.user.user.index',
'uses' => 'UserController@index',
'middleware' => 'can:user.users.index',
The value after
can: is the corresponding key in your
users.php config file rename
users.php configuration file was renamed to
config.php in the User module.
This mean if you used those configuration items in your modules you need to replace:
Translations have been removed
All translations files were removed from the individual modules and moved to the
Translation module. Therefore you will need to require the Translation module in your project. This can be done by running the following command in your project:
composer require asgardcms/translation-module
New authentication views
All authentication views were updated to the latest version of AdminLTE. If you were using the default authentication views and had them published, you will need to re-publish those views. This can be done with the following command:
php artisan vendor:publish --provider="Modules\User\Providers\UserServiceProvider" --force