How to give admin panel access to additional user group
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!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
- VirtualSpy
- Advanced
- Posts: 122
- Joined: 05 Jul 2022, 07:55
How to give admin panel access to additional user group
laravel version 9.48.0 , Aimeos version 2022.10.4 and PHP version 8.1.3 (Win)
i have created two additional group one for catalog management and one for order management , i know about permission for group https://github.com/aimeos/ai-admin-jqad ... source.php but i didn't get how to give access to additional groups.
i have created two additional group one for catalog management and one for order management , i know about permission for group https://github.com/aimeos/ai-admin-jqad ... source.php but i didn't get how to give access to additional groups.
Last edited by VirtualSpy on 03 Apr 2023, 14:28, edited 1 time in total.
Re: How to give admin panel access to addition user group
Access to panels is checked here:
https://github.com/aimeos/ai-admin-jqad ... hp#L45-L47
Just add the names of your additional groups in your ./config/shop.php for order and user panels:
- https://github.com/aimeos/ai-admin-jqad ... hp#L30-L55
- https://github.com/aimeos/ai-admin-jqad ... p#L73-L115
https://github.com/aimeos/ai-admin-jqad ... hp#L45-L47
Just add the names of your additional groups in your ./config/shop.php for order and user panels:
- https://github.com/aimeos/ai-admin-jqad ... hp#L30-L55
- https://github.com/aimeos/ai-admin-jqad ... p#L73-L115
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
- VirtualSpy
- Advanced
- Posts: 122
- Joined: 05 Jul 2022, 07:55
Re: How to give admin panel access to additional user group
Thanks for your response, I understood this, but I am not able to login in admin panel by additional customer group's email, I checked with SHOP_PERMISSION in env by adding an additional customer group code, but it is showing This action is unauthorized.aimeos wrote: ↑02 Apr 2023, 12:14 Access to panels is checked here:
https://github.com/aimeos/ai-admin-jqad ... hp#L45-L47
Just add the names of your additional groups in your ./config/shop.php for order and user panels:
- https://github.com/aimeos/ai-admin-jqad ... hp#L30-L55
- https://github.com/aimeos/ai-admin-jqad ... p#L73-L115
- VirtualSpy
- Advanced
- Posts: 122
- Joined: 05 Jul 2022, 07:55
Re: How to give admin panel access to additional user group
VirtualSpy wrote: ↑03 Apr 2023, 06:52Thanks for your response, I understood this, but I am not able to login in admin panel by additional customer group's email, I checked with SHOP_PERMISSION in env by adding an additional customer group code, but it is showing This action is unauthorized.aimeos wrote: ↑02 Apr 2023, 12:14 Access to panels is checked here:
https://github.com/aimeos/ai-admin-jqad ... hp#L45-L47
Just add the names of your additional groups in your ./config/shop.php for order and user panels:
- https://github.com/aimeos/ai-admin-jqad ... hp#L30-L55
- https://github.com/aimeos/ai-admin-jqad ... p#L73-L115
Aimeos ! Did you understand my problem?
- VirtualSpy
- Advanced
- Posts: 122
- Joined: 05 Jul 2022, 07:55
Re: How to give admin panel access to additional user group
Aimeos ! Will you reply? Thanks in Advance
Re: How to give admin panel access to additional user group
Guess, the problem is the fixed list of groups here:
https://github.com/aimeos/aimeos-larave ... er.php#L36
If it would be configurable, you can log in with users having different groups.
https://github.com/aimeos/aimeos-larave ... er.php#L36
If it would be configurable, you can log in with users having different groups.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
- VirtualSpy
- Advanced
- Posts: 122
- Joined: 05 Jul 2022, 07:55
Re: How to give admin panel access to additional user group
It was helpful, and because of this, I knew more. https://github.com/aimeos/aimeos-larave ... roller.php in this controller one configuration is usingaimeos wrote: ↑07 Apr 2023, 07:53 Guess, the problem is the fixed list of groups here:
https://github.com/aimeos/aimeos-larave ... er.php#L36
If it would be configurable, you can log in with users having different groups.
Code: Select all
if( config( 'shop.authorize', true ) ) {
$this->authorize( 'admin', [JqadmController::class, config( 'shop.roles', ['admin', 'editor'] )] );
}
but now I want to know the best way to overwrite the controllers because I want to overwrite https://github.com/aimeos/aimeos-larave ... er.php#L36 this controller.
- VirtualSpy
- Advanced
- Posts: 122
- Joined: 05 Jul 2022, 07:55
Re: How to give admin panel access to additional user group
I have overwritten the controller and route from Laravel, if you have any other way to overwrite it please share.VirtualSpy wrote: ↑10 Apr 2023, 08:08It was helpful, and because of this, I knew more. https://github.com/aimeos/aimeos-larave ... roller.php in this controller one configuration is usingaimeos wrote: ↑07 Apr 2023, 07:53 Guess, the problem is the fixed list of groups here:
https://github.com/aimeos/aimeos-larave ... er.php#L36
If it would be configurable, you can log in with users having different groups.Because of this config it was showing This action is unauthorized. so, I used this config in config/shop.php .Code: Select all
if( config( 'shop.authorize', true ) ) { $this->authorize( 'admin', [JqadmController::class, config( 'shop.roles', ['admin', 'editor'] )] ); }
but now I want to know the best way to overwrite the controllers because I want to overwrite https://github.com/aimeos/aimeos-larave ... er.php#L36 this controller.
Re: How to give admin panel access to additional user group
It would be best if the roles in the AdminController could be configured like in the JqadmController with:
Then, you can configure which roles can be used for the backend. If you can create a PR, we will be happy to merge it and port it back to 2022.10
Code: Select all
config( 'shop.roles', ['admin', 'editor'] )
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star