Page 1 of 1

Managing user roles

Posted: 09 Aug 2017, 09:38
by martijn
Laravel 5.4
Aimeos 2017.07
PHP 7.1.8
Environment: Linux (laravel homestead on windows)

I'm trying to find some documentation on managing user roles.
For instance, how can I change a user role after creating it with the php artisan command?
And can I access the role of a user through the base User model of laravel? If so, how?
I expected something like $user->role but that doesn't work.

Re: Managing user roles

Posted: 09 Aug 2017, 11:32
by aimeos
When using "./artisan aimeos:account --admin <email>", this adds a user group reference to the account via the users_list table. Laravel doesn't have the concept of groups stored in a database like other applications or frameworks (it has policies implemented as code), so there's no way to manage this data only by using the Laravel User object.

You can change the groups of a user/customer in the Aimeos admin interface instead. If you use the Aimeos objects, you can also change the group references via your own code.