new group privileges

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!
User avatar
GülsümAkça
Posts: 57
Joined: 20 Nov 2020, 13:30

new group privileges

Post by GülsümAkça » 08 Aug 2021, 16:38

hello. I created a new group . I want the new group to see only the product and order panel. how can i do that? thank you

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

Re: new group privileges

Post by aimeos » 09 Aug 2021, 06:42

Overwrite the permission configuration and add your group to the panels you want to allow:
- https://aimeos.org/docs/latest/admin/jq ... ermissions
- https://github.com/aimeos/ai-admin-jqad ... source.php

You must give the group acess to the dashboard too because it's the first panel that is shown.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
GülsümAkça
Posts: 57
Joined: 20 Nov 2020, 13:30

Re: new group privileges

Post by GülsümAkça » 09 Aug 2021, 15:27

hello, except for what you said, it is necessary to write code in the config/shop.php file, otherwise it gives an authorize error (413).
Added and solved, thanks.

Code: Select all

'roles' => [ 'editor' , 'admin' , 'mynewgroup' ]

nowrap
Posts: 37
Joined: 01 Mar 2023, 23:03

Re: new group privileges

Post by nowrap » 12 Jun 2023, 16:36

Hello and thanks for this guide so far.

I have two questions/problems.

I added to config/shop.php:
  • 'admin/jqadm/resource/dashboard/groups' => ['newgroup']
  • 'admin/jqadm/resource/order/groups' => ['newgroup']
  • 'roles' => ['editor', 'admin','newgroup']
If i login to /admin with a test user the dashboard isn't shown as default. But i can access it manually with /admin/default/jqadm/search/dashboard. How can the dashboard be the first view after login?

And i can an error (403) for this request in the dev console of the browser:
/admin/default/jsonadm

I tried to add to config/shop.php:
  • 'admin/jsonadm/resource/index/groups' => ['newgroup']
But the error is still present.

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

Re: new group privileges

Post by aimeos » 14 Jun 2023, 08:19

nowrap wrote: 12 Jun 2023, 16:36 I added to config/shop.php:
  • 'admin/jqadm/resource/dashboard/groups' => ['newgroup']
  • 'admin/jqadm/resource/order/groups' => ['newgroup']
  • 'roles' => ['editor', 'admin','newgroup']
If i login to /admin with a test user the dashboard isn't shown as default. But i can access it manually with /admin/default/jqadm/search/dashboard. How can the dashboard be the first view after login?
Did you try to add all groups instead?

Code: Select all

['super', 'editor', 'admin','newgroup']
nowrap wrote: 12 Jun 2023, 16:36 And i can an error (403) for this request in the dev console of the browser:
/admin/default/jsonadm

I tried to add to config/shop.php:
  • 'admin/jsonadm/resource/index/groups' => ['newgroup']
The JSON admin API is restricted to the configured groups for each endpoint. You need to make sure that your new group has access to all API endpoints that are used by the allowed panels. Here's the default configuration:
https://raw.githubusercontent.com/aimeo ... source.php
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

nowrap
Posts: 37
Joined: 01 Mar 2023, 23:03

Re: new group privileges

Post by nowrap » 27 Jun 2023, 21:22

Thx for your reply.

I added the other groups to the config/shop.php but this doesn't change the behaviour to automatically navigate to the admin dashboard view. It opens the /profile page.

The request to /admin/default/jsonadm?locale=de is an options request. I tried to follow the source code to find the origin of the exception for the 403 response. It's the JsonadmController.php in method optionsAction:
https://github.com/aimeos/aimeos-larave ... r.php#L116

There the groups seems to be hardcoded?

Code: Select all

$this->authorize( 'admin', [JsonadmController::class, ['admin', 'editor', 'api']] );
For testing i added my new group. After this the request finishes. But i still have a lot of spinning icons. Only the newest orders are presented correctly.
dashboard.png
dashboard.png (102.38 KiB) Viewed 23976 times
Regards
nowrap

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

Re: new group privileges

Post by aimeos » 30 Jun 2023, 07:43

Yes, the fixed auth groups for the Laravel Jsonadm controller are a problem for adding new groups. We've already thought to make that configurable. Would that be sufficient to finally add new backend groups?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

nowrap
Posts: 37
Joined: 01 Mar 2023, 23:03

Re: new group privileges

Post by nowrap » 02 Jul 2023, 18:09

For us we have only two wishes:
  • option to configure which admin views are accasible for a new group
  • set an admin page as standard view after login for a new group

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

Re: new group privileges

Post by aimeos » 06 Jul 2023, 10:23

nowrap wrote: 02 Jul 2023, 18:09
  • option to configure which admin views are accasible for a new group
  • set an admin page as standard view after login for a new group
The Aimeos 2023.07.1 package released today contains two settings which allows you to configure the groups that are allowed to access the admin backend (incl. JSON admin API) and the default panel. In the ./config/shop.php use:

Code: Select all

	'roles' => ['admin', 'editor', 'newgroup'],
	'panel' => 'order',
Enjoy!
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

nowrap
Posts: 37
Joined: 01 Mar 2023, 23:03

Re: new group privileges

Post by nowrap » 19 Jul 2023, 19:30

Thx, alot!

Sorry for answering so late. So we have to upgrade from 2022.x to 2023.x first in order to use this improvement.

Post Reply