Managing user roles

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
martijn
Posts: 1
Joined: 09 Aug 2017, 09:22

Managing user roles

Post by martijn » 09 Aug 2017, 09:38

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.

User avatar
aimeos
Administrator
Posts: 7866
Joined: 01 Jan 1970, 00:00

Re: Managing user roles

Post by aimeos » 09 Aug 2017, 11:32

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.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply