External administrator or editor authorization

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!
EmperorOfPlanets
Posts: 3
Joined: 30 Sep 2023, 10:54

External administrator or editor authorization

Post by EmperorOfPlanets » 30 Sep 2023, 12:09

Aimeos uses separate authorization! Can I grant permissions to a user or editor within a session! I created an external authorization and my user ID is stored in the session. So that you can assign a role to a session? Sorry, I'm using a translator)

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

Re: External administrator or editor authorization

Post by aimeos » 02 Oct 2023, 12:51

Authorization is done by the access view helper and you can create your own class which queries external authorization sources:
https://github.com/aimeos/aimeos-base/b ... andard.php

Then, extend the context service class and overwrite the addAccess() method:
https://github.com/aimeos/aimeos-larave ... p#L92-L113

Finally, you have to register your new service class like done here in Laravel:
https://github.com/aimeos/aimeos-larave ... hp#L76-L98
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

EmperorOfPlanets
Posts: 3
Joined: 30 Sep 2023, 10:54

Re: External administrator or editor authorization

Post by EmperorOfPlanets » 03 Oct 2023, 16:09

Thanks, I'll try to do it

EmperorOfPlanets
Posts: 3
Joined: 30 Sep 2023, 10:54

Re: External administrator or editor authorization

Post by EmperorOfPlanets » 16 Oct 2023, 04:23

aimeos wrote: 02 Oct 2023, 12:51 Authorization is done by the access view helper and you can create your own class which queries external authorization sources:
https://github.com/aimeos/aimeos-base/b ... andard.php

Then, extend the context service class and overwrite the addAccess() method:
https://github.com/aimeos/aimeos-larave ... p#L92-L113

Finally, you have to register your new service class like done here in Laravel:
https://github.com/aimeos/aimeos-larave ... hp#L76-L98
So as not to spoil the core! I want to inherit! Where do I need to place the file in the app folder? I understand I need to do extensions
Attachments
doc_2023-10-16_09-23-07.png
doc_2023-10-16_09-23-07.png (82.8 KiB) Viewed 23796 times

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

Re: External administrator or editor authorization

Post by aimeos » 17 Oct 2023, 06:53

The directory structure must match the PHP namespace of the class so it should be OK. Run "composer dump-autoload" to update the composer files in the vendor directory so it knows the new class.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply