How to differentiate between admin and customers?

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!
lockhart97
Posts: 11
Joined: 17 Aug 2023, 00:16

How to differentiate between admin and customers?

Post by lockhart97 » 14 Dec 2023, 20:32

Laravel framework version: 10.18.0
Aimeos Laravel version: 2023.07
PHP Version: 8.2.8
Environment: Linux

How can I differentiate users added via `php artisan aimeos:account --admin test@example.com` and users added via 'Customer Manager'. I went through the users table. It was not able to find a column which can help me differentiate if the users is admin or customer. I was also not able to find any relational table for this information.

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

Re: How to differentiate between admin and customers?

Post by aimeos » 18 Dec 2023, 13:56

Super users contain a flag in the "superuser" column of the "users" table. "admin" and "editor" accounts contain the corresponding group attached via the "users_list" table.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

lockhart97
Posts: 11
Joined: 17 Aug 2023, 00:16

Re: How to differentiate between admin and customers?

Post by lockhart97 » 18 Dec 2023, 15:14

Thank you.

Further, how can I differentiate if a user is customer, since aimeos-laravel uses same table both for customers and admins?

If a user does not have super-admin flag and does not have an entry in corresponding users-list table, then he should be a customer. Is this approach correct or is there some other way to identify customers?

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

Re: How to differentiate between admin and customers?

Post by aimeos » 18 Dec 2023, 15:17

lockhart97 wrote: 18 Dec 2023, 15:14 If a user does not have super-admin flag and does not have an entry in corresponding users-list table, then he should be a customer.
If they have no entry for domain "customer/groups" (or "groups" in dev-master) that relates to the "admin" or "editor" record in the mshop_customer_group table (or mshop_group in dev-master). They can have additional groups assigned but only "admin" and "editor" groups are allowed to access the admin backend.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

lockhart97
Posts: 11
Joined: 17 Aug 2023, 00:16

Re: How to differentiate between admin and customers?

Post by lockhart97 » 20 Dec 2023, 08:46

Thank you for clarification.

Post Reply